/*
 * ConexionBD.java
 */

package datos;

import control.*;
import java.sql.*;
import java.util.*;

/**
 *
 * @author Draggoth
 */
public class ConexionBD {

    private static String user = "postgres";
    private static String password = "postgres";
    private static String url = "jdbc:postgresql://localhost:5432/HospitalesSede";
    private static Connection conn = null;
    
    public static boolean conectar() {
        boolean conectado = false;

        if(conn == null) {
            try {
                Class.forName("org.postgresql.Driver");
                conn = DriverManager.getConnection(url, user, password);
                conectado = true;
            }
            catch (SQLException ex) {
                System.err.println("SQLException: " + ex.getMessage());
                System.err.println("SQLState: " + ex.getSQLState());
                System.err.println("VendorError: " + ex.getErrorCode());
            }
            catch (ClassNotFoundException ex)
            {
                System.err.println("Driver not found: " + ex.getMessage());
            }
        }
        else {
            conectado = true;
        }

        return conectado;
    }

    public static void cerrar() {
        if (conn != null) {
            try {
                conn.close();
            } catch (SQLException sqlEx) { } // ignore
            
            conn = null;
        }
    }

    public static List<String> busquedaVisitas(String edo_visita) {

        List<String> col_v = new ArrayList<String>();

        try {
            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT * FROM sp_buscaFormulariosVisita('"+edo_visita+"');") ) {
                rs = smt.getResultSet();

                while( rs.next() ) {
                    col_v.add( rs.getString(1) );
                }
            }
        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }

        return col_v;
    }

    public static List<CursoBean> busquedaCursos() {

        List<CursoBean> cursos = new ArrayList<CursoBean>();
        CursoBean cb = null;

        try {
            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdCurso,sNombreCurso,sProfesorTitular,sTelefonoProfesorTitular,sMailProfesorTitular FROM CCursos") ) {
                rs = smt.getResultSet();

                while( rs.next() ) {
                    cb = new CursoBean();

                    cb.setnIdCurso( rs.getInt(1) );
                    cb.setsNombreCurso( rs.getString(2) );
                    cb.setsProfesorTitular( rs.getString(3) );
                    cb.setsTelefonoProfesorTitular( rs.getString(4) );
                    cb.setsMailProfesorTitular( rs.getString(5) );

                    cursos.add( cb );
                }
            }
        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }

        return cursos;
    }

    public static List<HospitalSedeBean> busquedaHospitales() {

        List<HospitalSedeBean> hospitales = new ArrayList<HospitalSedeBean>();
        HospitalSedeBean hs = null;

        try {
            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdHospital,sNombreHospital,sDireccion,sTelefono,sDirector,"
                          + "sTelefonoDirector,sJefeEnsenanza,sTelefonoJefeEnsenanza,sMailJefeEnsenanza FROM CHospitalesSede") ) {
                rs = smt.getResultSet();

                while( rs.next() ) {
                    hs = new HospitalSedeBean();

                    hs.setnIdHospital( rs.getInt(1) );
                    hs.setsNombreHospital( rs.getString(2) );
                    hs.setsDireccion( rs.getString(3) );
                    hs.setsTelefono( rs.getString(4) );
                    hs.setsDirector( rs.getString(5) );
                    hs.setsTelefonoDirector( rs.getString(6) );
                    hs.setsJefeEnsenanza( rs.getString(7) );
                    hs.setsTelefonoJefeEnsenanza( rs.getString(8) );
                    hs.setsMailJefeEnsenanza( rs.getString(9) );

                    hospitales.add( hs );
                }
            }
        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }

        return hospitales;
    }

    public static boolean insercionFormulario1(FormularioBean1 form1) {

        boolean exito = false;

        try {
            CallableStatement
            cs1 = conn.prepareCall("{call sp_insercionformulario1(?, ?, ?, ?, ?, ?,"
                       + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                       + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                       + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");
            cs1.setInt(1 , form1.getnIdHospital());
            cs1.setInt(2 , form1.getnIdCurso());
            cs1.setInt(3 , form1.getnEspecialistasMatutino());
            cs1.setInt(4 , form1.getnEspecialistasVespertino());
            cs1.setInt(5 , form1.getnEspecialistasNocturno());
            cs1.setInt(6 , form1.getnEspecialistasFinesSemana());
            cs1.setInt(7 , form1.getnCamasAdultos());
            cs1.setInt(8 , form1.getnCamasNinos());
            cs1.setInt(9 , form1.getnCunas());
            cs1.setInt(10, form1.getnIncubadoras());
            cs1.setString(11, form1.getsOtrasCensables());
            cs1.setInt(12, form1.getnOtrasCensables());
            cs1.setString(13, form1.getsEspecificacionCensables());
            cs1.setInt(14, form1.getnUrgencias());
            cs1.setInt(15, form1.getnTerapiaIntensiva());
            cs1.setInt(16, form1.getnTerapiaIntermedia());
            cs1.setInt(17, form1.getnCirugiaAmbulatoria());
            cs1.setInt(18, form1.getnLaboratorioGabinete());
            cs1.setInt(19, form1.getnCunasNeonatosSanos());
            cs1.setInt(20, form1.getnCamasRecuperacionQuirofano());
            cs1.setInt(21, form1.getnTrabajoParto());
            cs1.setString(22, form1.getsOtrasNoCensables());
            cs1.setInt(23, form1.getnOtrasNoCensables());
            cs1.setString(24, form1.getsEspecificacionNoCensables());
            cs1.setString(25, form1.getsQuirofanos());
            cs1.setInt(26, form1.getnQuirofanos());
            cs1.setString(27, form1.getsSalasExpulsion());
            cs1.setInt(28, form1.getnSalasExpulsion());
            cs1.setString(29, form1.getsConsultaExterna());
            cs1.setInt(30, form1.getnConsultaExterna());
            cs1.setString(31, form1.getsSistemaRegistroCodificacion());
            cs1.setInt(32, form1.getnSistemaRegistroCodificacion());
            cs1.setString(33, form1.getsManualNormasProcedimientos());
            cs1.setInt(34, form1.getnManualNormasProcedimientos());
            cs1.setString(35, form1.getsArchivoMaterialDidactico());
            cs1.setInt(36, form1.getnArchivoMaterialDidactico());
            cs1.setString(37, form1.getsLaboratorioRutina());
            cs1.setString(38, form1.getsCondicionesLaboratorioRutina());
            cs1.setString(39, form1.getsComentariosLaboratorioRutina());
            cs1.setString(40, form1.getsLaboratoriosEspeciales());
            cs1.setString(41, form1.getsEspecificacionLaboratoriosEspeciales());
            cs1.setString(42, form1.getsCondicionesLaboratoriosEspeciales());
            cs1.setString(43, form1.getsComentarioLaboratoriosEspeciales());
            cs1.setString(44, form1.getsGabinetes());
            cs1.setString(45, form1.getsEspecificacionGabinetes());
            cs1.setString(46, form1.getsCondicionGabinetes());
            cs1.setString(47, form1.getsComentariosGabinetes());
            cs1.setString(48, form1.getsOtrosDiagnosticoTratamiento());
            cs1.setString(49, form1.getsEspecificacionOtrosDiagnosticoTratamiento());
            cs1.setString(50, form1.getsCondicionesOtrosDiagnosticoTratamiento());
            cs1.setString(51, form1.getsComentarioOtrosDiagnosticoTratamiento());
            cs1.setString(52, form1.getsComiteMorbilidad());
            cs1.setString(53, form1.getsComiteMortalidad());
            cs1.setString(54, form1.getsComiteInfecciones());
            cs1.setString(55, form1.getsComiteExpedienteClinico());
            cs1.setString(56, form1.getsComiteBioeticaEtica());
            cs1.setString(57, form1.getsComiteAuditoriaMedica());
            cs1.setString(58, form1.getsComiteEnsenanza());
            cs1.setString(59, form1.getsComiteBioseguridad());
            cs1.setString(60, form1.getsComiteCientifico());
            cs1.setString(61, form1.getsOtrosComites());
            cs1.setString(62, form1.getsEspecificacionOtrosComites());
            cs1.setInt(63, form1.getnIdVisita());

            cs1.execute();

            CallableStatement
            cs1aux = conn.prepareCall("{call sp_insercionauxiliarformulario1(?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");

            cs1aux.setString(1 , form1.getsProfesor1());
            cs1aux.setString(2 , form1.getsNombramiento1());
            cs1aux.setString(3 , form1.getsGrado1());
            cs1aux.setInt(4 , form1.getnAntiguedad1());
            cs1aux.setString(5, form1.getsCursos1());
            cs1aux.setString(6, form1.getsCertificado1());
            cs1aux.setString(7 , form1.getsProfesor2());
            cs1aux.setString(8 , form1.getsNombramiento2());
            cs1aux.setString(9 , form1.getsGrado2());
            cs1aux.setInt(10 , form1.getnAntiguedad2());
            cs1aux.setString(11, form1.getsCursos2());
            cs1aux.setString(12, form1.getsCertificado2());
            cs1aux.setString(13, form1.getsProfesor3());
            cs1aux.setString(14, form1.getsNombramiento3());
            cs1aux.setString(15, form1.getsGrado3());
            cs1aux.setInt(16, form1.getnAntiguedad3());
            cs1aux.setString(17, form1.getsCursos3());
            cs1aux.setString(18, form1.getsCertificado3());
            cs1aux.setString(19, form1.getsProfesor4());
            cs1aux.setString(20, form1.getsNombramiento4());
            cs1aux.setString(21, form1.getsGrado4());
            cs1aux.setInt(22, form1.getnAntiguedad4());
            cs1aux.setString(23, form1.getsCursos4());
            cs1aux.setString(24, form1.getsCertificado4());
            cs1aux.setString(25, form1.getsProfesor5());
            cs1aux.setString(26, form1.getsNombramiento5());
            cs1aux.setString(27, form1.getsGrado5());
            cs1aux.setInt(28, form1.getnAntiguedad5());
            cs1aux.setString(29, form1.getsCursos5());
            cs1aux.setString(30, form1.getsCertificado5());
            cs1aux.setString(31, form1.getsProfesor6());
            cs1aux.setString(32, form1.getsNombramiento6());
            cs1aux.setString(33, form1.getsGrado6());
            cs1aux.setInt(34, form1.getnAntiguedad6());
            cs1aux.setString(35, form1.getsCursos6());
            cs1aux.setString(36, form1.getsCertificado6());
            cs1aux.setString(37, form1.getsProfesor7());
            cs1aux.setString(38, form1.getsNombramiento7());
            cs1aux.setString(39, form1.getsGrado7());
            cs1aux.setInt(40, form1.getnAntiguedad7());
            cs1aux.setString(41, form1.getsCursos7());
            cs1aux.setString(42, form1.getsCertificado7());
            cs1aux.setString(43, form1.getsProfesor8());
            cs1aux.setString(44, form1.getsNombramiento8());
            cs1aux.setString(45, form1.getsGrado8());
            cs1aux.setInt(46, form1.getnAntiguedad8());
            cs1aux.setString(47, form1.getsCursos8());
            cs1aux.setString(48, form1.getsCertificado8());
            cs1aux.setString(49, form1.getsProfesor9());
            cs1aux.setString(50, form1.getsNombramiento9());
            cs1aux.setString(51, form1.getsGrado9());
            cs1aux.setInt(52, form1.getnAntiguedad9());
            cs1aux.setString(53, form1.getsCursos9());
            cs1aux.setString(54, form1.getsCertificado9());
            cs1aux.setString(55, form1.getsProfesor0());
            cs1aux.setString(56, form1.getsNombramiento0());
            cs1aux.setString(57, form1.getsGrado0());
            cs1aux.setInt(58, form1.getnAntiguedad0());
            cs1aux.setString(59, form1.getsCursos0());
            cs1aux.setString(60, form1.getsCertificado0());

            cs1aux.execute();

            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdFormulario1 FROM Formulario1 WHERE nIdVisita = " + form1.getnIdVisita()) ) {
                rs = smt.getResultSet();

                if( rs.next() ) {
                    form1.setnIdFormulario( rs.getInt(1) );
                }
            }

            if( smt.execute("UPDATE Visitas SET(sEstado) = ('incompletas') WHERE nIdVisita = " + form1.getnIdVisita()) ) {

            }

            exito = true;
        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean insercionFormulario2(FormularioBean2 form2) {

        boolean exito = false;

        try {
            CallableStatement
            cs2 = conn.prepareCall("{call sp_insercionformulario2(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");

            cs2.setString(1 , form2.getsNombreCo1());
            cs2.setString(2 , form2.getsNombreCo2());
            cs2.setString(3 , form2.getsNombreCo3());
            cs2.setString(4 , form2.getsNombreCo4());
            cs2.setString(5 , form2.getsNombreCo5());
            cs2.setString(6 , form2.getsNombreCo6());
            cs2.setString(7 , form2.getsNombreCo7());
            cs2.setString(8 , form2.getsNombreCo8());
            cs2.setString(9 , form2.getsNombreCo9());
            cs2.setString(10 , form2.getsNombreCo0());
            cs2.setString(11, form2.getsNombreCh1());
            cs2.setString(12, form2.getsNombreCh2());
            cs2.setString(13, form2.getsNombreCh3());
            cs2.setString(14, form2.getsNombreCh4());
            cs2.setString(15, form2.getsNombreCh5());
            cs2.setString(16, form2.getsNombreCh6());
            cs2.setString(17, form2.getsNombreCh7());
            cs2.setString(18, form2.getsNombreCh8());
            cs2.setString(19, form2.getsNombreCh9());
            cs2.setString(20, form2.getsNombreCh0());
            cs2.setString(21, form2.getsNombreP1());
            cs2.setString(22, form2.getsNombreP2());
            cs2.setString(23, form2.getsNombreP3());
            cs2.setString(24, form2.getsNombreP4());
            cs2.setString(25, form2.getsNombreP5());
            cs2.setString(26, form2.getsNombreP6());
            cs2.setString(27, form2.getsNombreP7());
            cs2.setString(28, form2.getsNombreP8());
            cs2.setString(29, form2.getsNombreP9());
            cs2.setString(30, form2.getsNombreP0());
            cs2.setString(31, form2.getsNombreCom1());
            cs2.setString(32, form2.getsNombreCom2());
            cs2.setString(33, form2.getsNombreCom3());
            cs2.setString(34, form2.getsNombreCom4());
            cs2.setString(35, form2.getsNombreCom5());
            cs2.setString(36, form2.getsNombreCom6());
            cs2.setString(37, form2.getsNombreCom7());
            cs2.setString(38, form2.getsNombreCom8());
            cs2.setString(39, form2.getsNombreCom9());
            cs2.setString(40, form2.getsNombreCom0());
            cs2.setString(41, form2.getsNombreElab1());
            cs2.setString(42, form2.getsNombreElab2());
            cs2.setString(43, form2.getsNombreElab3());
            cs2.setString(44, form2.getsNombreElab4());
            cs2.setString(45, form2.getsNombreElab5());
            cs2.setString(46, form2.getsNombreElab6());
            cs2.setString(47, form2.getsNombreElab7());
            cs2.setString(48, form2.getsNombreElab8());
            cs2.setString(49, form2.getsNombreElab9());
            cs2.setString(50, form2.getsNombreElab0());
            cs2.setString(51, form2.getsNombreEg1());
            cs2.setString(52, form2.getsNombreEg2());
            cs2.setString(53, form2.getsNombreEg3());
            cs2.setString(54, form2.getsNombreEg4());
            cs2.setString(55, form2.getsNombreEg5());
            cs2.setString(56, form2.getsNombreEg6());
            cs2.setString(57, form2.getsNombreEg7());
            cs2.setString(58, form2.getsNombreEg8());
            cs2.setString(59, form2.getsNombreEg9());
            cs2.setString(60, form2.getsNombreEg0());
            cs2.setString(61, form2.getsNombrePi1());
            cs2.setString(62, form2.getsNombrePi2());
            cs2.setString(63, form2.getsNombrePi3());
            cs2.setString(64, form2.getsNombrePi4());
            cs2.setString(65, form2.getsNombrePi5());
            cs2.setString(66, form2.getsNombrePi6());
            cs2.setString(67, form2.getsNombrePi7());
            cs2.setString(68, form2.getsNombrePi8());
            cs2.setString(69, form2.getsNombrePi9());
            cs2.setString(70, form2.getsNombrePi0());
            cs2.setInt(71, form2.getnPromedioMensualConsultasExternas());
            cs2.setInt(72, form2.getnAltasMejoriaCuracion());
            cs2.setInt(73, form2.getnAltaDefuncion());
            cs2.setInt(74, form2.getnPromedioMensualIntervenciones());
            cs2.setInt(75, form2.getnPromedioMensualPartosAtendidos());
            cs2.setInt(76, form2.getnAutopsias());
            cs2.setInt(77, form2.getnBiopsias());
            cs2.setInt(78, form2.getnCitologias());
            cs2.setInt(79, form2.getnIdVisita());

            cs2.execute();

            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdFormulario2 FROM Formulario2 WHERE nIdVisita = " + form2.getnIdVisita()) ) {
                rs = smt.getResultSet();

                if( rs.next() ) {
                    form2.setnIdFormulario( rs.getInt(1) );
                }
            }

            if( smt.execute("UPDATE Visitas SET(sEstado) = ('incompletas') WHERE nIdVisita = " + form2.getnIdVisita()) ) {

            }

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean insercionFormulario3(FormularioBean3 form3) {

        boolean exito = false;

        try {
            CallableStatement
            cs3 = conn.prepareCall("{call sp_insercionformulario3(?, ?, ?, ?, ?, "
                + "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
                + "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
                + "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
                + "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");

            cs3.setString(1 , form3.getsPromedioMinimo());
            cs3.setInt(2 , form3.getnEspecificarPromedioMinimo());
            cs3.setString(3 , form3.getsExamenNacionalResidencias());
            cs3.setString(4 , form3.getsExamenCompetenciaAcademicaUNAM());
            cs3.setString(5 , form3.getsExamenTeoricoConocimientos());
            cs3.setString(6 , form3.getsResidenciaRotatoria());
            cs3.setString(7 , form3.getsExamenPsicometrico());
            cs3.setString(8 , form3.getsExamenIngles());
            cs3.setString(9 , form3.getsExamenPracticoDestrezas());
            cs3.setString(10 , form3.getsExamenSaludFisica());
            cs3.setString(11 , form3.getsEntrevistaPersonal());
            cs3.setString(12 , form3.getsAntecedentesInstitucionSalud());
            cs3.setString(13 , form3.getsEdadMaxima());
            cs3.setInt(14 , form3.getnEspecificacionEdadMaxima());
            cs3.setString(15 , form3.getsEstudiosPreviosOtraEspecialidad());
            cs3.setString(16 , form3.getsOtroCriterioAdmision());
            cs3.setString(17 , form3.getsEspecificarCriterioAdmision());
            cs3.setInt(18, form3.getnDuracionCurso());
            cs3.setString(19 , form3.getsEstudiosPreviosOtraEspecialidadMedica());
            cs3.setInt(20, form3.getnDuracionOtraEspecialidad());
            cs3.setString(21, form3.getsEspecificacionOtraEspecialidad());
            cs3.setString(22 , form3.getsResidenciaSoloUnidad());
            cs3.setString(23 , form3.getsUnidadesComplementarias());
            cs3.setString(24 , form3.getsPorObjetivos());
            cs3.setString(25 , form3.getsProgramaOperativo());
            cs3.setString(26 , form3.getsListadoTemas());
            cs3.setString(27 , form3.getsCartaDescriptiva());
            cs3.setString(28 , form3.getsProgramaRotacion());
            cs3.setString(29 , form3.getsModular());
            cs3.setString(30 , form3.getsAsignatura());
            cs3.setString(31 , form3.getsPorAnos());
            cs3.setString(32 , form3.getsPorSemestres());
            cs3.setString(33 , form3.getsOtraCaracteristica());
            cs3.setString(34 , form3.getsEspecificacionOtras());
            cs3.setString(35 , form3.getsAlumnosResidenciasFormales());
            cs3.setInt(36, form3.getnActividadesTeoricasGrupo());
            cs3.setInt(37, form3.getnActividadesTeoricasIndependientes());
            cs3.setInt(38, form3.getnPracticaClinicaIndependiente());
            cs3.setInt(39, form3.getnPracticaClinicaTutoria());
            cs3.setInt(40, form3.getnActivadadesInvestigacion());
            cs3.setInt(41, form3.getnActualizacion());
            cs3.setInt(42, form3.getnAplicacion());
            cs3.setInt(43, form3.getnGeneracion());
            cs3.setInt(44, form3.getnDesarrolloAutonomia());
            cs3.setInt(45, form3.getnDesarrolloCapacidades());
            cs3.setString(46, form3.getsSituacionesDesarrolloDestrezas());
            cs3.setString(47, form3.getsSituacionesGraduacionDestrezas());
            cs3.setString(48, form3.getsEnsenanzaDestrezasResidentes());
            cs3.setString(49, form3.getsEnsenanzaDestrezasProfesores());
            cs3.setString(50, form3.getsSupervisionDominio());
            cs3.setString(51, form3.getsProgramanActividades());
            cs3.setString(52, form3.getsExamenTeoricoOral());
            cs3.setString(53, form3.getsPeriodicidadExamenTeoricoOral());
            cs3.setString(54, form3.getsExamenTeoricoEscrito());
            cs3.setString(55, form3.getsPeriodicidadExamenTeoricoEscrito());
            cs3.setString(56, form3.getsExamenPractico());
            cs3.setString(57, form3.getsPeriodicidadExamenPractico());
            cs3.setString(58, form3.getsListasCotejo());
            cs3.setString(59, form3.getsObservacionLibre());
            cs3.setString(60, form3.getsGuiaObservacion());
            cs3.setString(61, form3.getsEscalasEvaluativas());
            cs3.setString(62, form3.getsOtroProcedimiento());
            cs3.setString(63, form3.getsEspecificarOtroProcedimiento());
            cs3.setString(64, form3.getsRetroalimentacion());
            cs3.setString(65, form3.getsPeriodicidadProgramaOperativo());
            cs3.setString(66, form3.getsAlumnosEnDepartamentales());
            cs3.setInt(67, form3.getnPorcentajeDepartamental());
            cs3.setInt(68, form3.getnSeminarioAtencionMedica());
            cs3.setInt(69, form3.getnTrabajoAtencionMedica());
            cs3.setInt(70, form3.getnSeminarioInvestigacion());
            cs3.setInt(71, form3.getnSeminarioEducacion());
            cs3.setString(72, form3.getsDificultades());
            cs3.setString(73, form3.getsEspecificacionDificultades());
            cs3.setString(74, form3.getsPercepcionEstres());
            cs3.setString(75, form3.getsComentariosPercepcionesEstres());
            cs3.setInt(76, form3.getnIdVisita());

            cs3.execute();

            CallableStatement
            cs3aux1 = conn.prepareCall("{call sp_insercionauxiliar1formulario3(?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?)}");

            cs3aux1.setString(1, form3.getsAreaRotacionPropia1());
            cs3aux1.setInt(2, form3.getnTiempoAreaRotacionPropia1());
            cs3aux1.setString(3, form3.getsAreaRotacionPropia2());
            cs3aux1.setInt(4, form3.getnTiempoAreaRotacionPropia2());
            cs3aux1.setString(5, form3.getsAreaRotacionPropia3());
            cs3aux1.setInt(6, form3.getnTiempoAreaRotacionPropia3());
            cs3aux1.setString(7, form3.getsAreaRotacionPropia4());
            cs3aux1.setInt(8, form3.getnTiempoAreaRotacionPropia4());
            cs3aux1.setString(9, form3.getsAreaRotacionPropia5());
            cs3aux1.setInt(10, form3.getnTiempoAreaRotacionPropia5());
            cs3aux1.setString(11, form3.getsAreaRotacionPropia6());
            cs3aux1.setInt(12, form3.getnTiempoAreaRotacionPropia6());
            cs3aux1.setString(13, form3.getsAreaRotacionPropia7());
            cs3aux1.setInt(14, form3.getnTiempoAreaRotacionPropia7());
            cs3aux1.setString(15, form3.getsAreaRotacionPropia8());
            cs3aux1.setInt(16, form3.getnTiempoAreaRotacionPropia8());
            cs3aux1.setString(17, form3.getsAreaRotacionPropia9());
            cs3aux1.setInt(18, form3.getnTiempoAreaRotacionPropia9());
            cs3aux1.setString(19, form3.getsAreaRotacionPropia0());
            cs3aux1.setInt(20, form3.getnTiempoAreaRotacionPropia0());
            cs3aux1.setString(21, form3.getsAreaRotacionComplementaria1());
            cs3aux1.setInt(22, form3.getnTiempoAreaRotacionComplementaria1());
            cs3aux1.setString(23, form3.getsAreaRotacionComplementaria2());
            cs3aux1.setInt(24, form3.getnTiempoAreaRotacionComplementaria2());
            cs3aux1.setString(25, form3.getsAreaRotacionComplementaria3());
            cs3aux1.setInt(26, form3.getnTiempoAreaRotacionComplementaria3());
            cs3aux1.setString(27, form3.getsAreaRotacionComplementaria4());
            cs3aux1.setInt(28, form3.getnTiempoAreaRotacionComplementaria4());
            cs3aux1.setString(29, form3.getsAreaRotacionComplementaria5());
            cs3aux1.setInt(30, form3.getnTiempoAreaRotacionComplementaria5());
            cs3aux1.setString(31, form3.getsAreaRotacionComplementaria6());
            cs3aux1.setInt(32, form3.getnTiempoAreaRotacionComplementaria6());
            cs3aux1.setString(33, form3.getsAreaRotacionComplementaria7());
            cs3aux1.setInt(34, form3.getnTiempoAreaRotacionComplementaria7());
            cs3aux1.setString(35, form3.getsAreaRotacionComplementaria8());
            cs3aux1.setInt(36, form3.getnTiempoAreaRotacionComplementaria8());
            cs3aux1.setString(37, form3.getsAreaRotacionComplementaria9());
            cs3aux1.setInt(38, form3.getnTiempoAreaRotacionComplementaria9());
            cs3aux1.setString(39, form3.getsAreaRotacionComplementaria0());
            cs3aux1.setInt(40, form3.getnTiempoAreaRotacionComplementaria0());
            cs3aux1.setString(41, form3.getsAreaSubsede1());
            cs3aux1.setInt(42, form3.getnTiempoSubsede1());
            cs3aux1.setString(43, form3.getsAreaSubsede2());
            cs3aux1.setInt(44, form3.getnTiempoSubsede2());
            cs3aux1.setString(45, form3.getsAreaSubsede3());
            cs3aux1.setInt(46, form3.getnTiempoSubsede3());
            cs3aux1.setString(47, form3.getsAreaSubsede4());
            cs3aux1.setInt(48, form3.getnTiempoSubsede4());
            cs3aux1.setString(49, form3.getsAreaSubsede5());
            cs3aux1.setInt(50, form3.getnTiempoSubsede5());
            cs3aux1.setString(51, form3.getsAreaSubsede6());
            cs3aux1.setInt(52, form3.getnTiempoSubsede6());
            cs3aux1.setString(53, form3.getsAreaSubsede7());
            cs3aux1.setInt(54, form3.getnTiempoSubsede7());
            cs3aux1.setString(55, form3.getsAreaSubsede8());
            cs3aux1.setInt(56, form3.getnTiempoSubsede8());
            cs3aux1.setString(57, form3.getsAreaSubsede9());
            cs3aux1.setInt(58, form3.getnTiempoSubsede9());
            cs3aux1.setString(59, form3.getsAreaSubsede0());
            cs3aux1.setInt(60, form3.getnTiempoSubsede0());
            cs3aux1.setInt(61, form3.getnExternoR1());
            cs3aux1.setInt(62, form3.getnExternoR2());
            cs3aux1.setInt(63, form3.getnExternoR3());
            cs3aux1.setInt(64, form3.getnExternoR4());
            cs3aux1.setInt(65, form3.getnExternoR5());
            cs3aux1.setInt(66, form3.getnExternoR6());
            cs3aux1.setInt(67, form3.getnExternoOtros());

            cs3aux1.execute();

            CallableStatement
            cs3aux2 = conn.prepareCall("{call sp_insercionauxiliar2formulario3(?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");

            cs3aux2.setString(1, form3.getsNombre1());
            cs3aux2.setString(2, form3.getsNombreTrabajoInvestigacionResidente1());
            cs3aux2.setString(3, form3.getsPublicado1());
            cs3aux2.setString(4, form3.getsReferencia1());
            cs3aux2.setString(5, form3.getsNombre2());
            cs3aux2.setString(6, form3.getsNombreTrabajoInvestigacionResidente2());
            cs3aux2.setString(7, form3.getsPublicado2());
            cs3aux2.setString(8, form3.getsReferencia2());
            cs3aux2.setString(9, form3.getsNombre3());
            cs3aux2.setString(10, form3.getsNombreTrabajoInvestigacionResidente3());
            cs3aux2.setString(11, form3.getsPublicado3());
            cs3aux2.setString(12, form3.getsReferencia3());
            cs3aux2.setString(13, form3.getsNombre4());
            cs3aux2.setString(14, form3.getsNombreTrabajoInvestigacionResidente4());
            cs3aux2.setString(15, form3.getsPublicado4());
            cs3aux2.setString(16, form3.getsReferencia4());
            cs3aux2.setString(17, form3.getsNombre5());
            cs3aux2.setString(18, form3.getsNombreTrabajoInvestigacionResidente5());
            cs3aux2.setString(19, form3.getsPublicado5());
            cs3aux2.setString(20, form3.getsReferencia5());
            cs3aux2.setString(21, form3.getsNombre6());
            cs3aux2.setString(22, form3.getsNombreTrabajoInvestigacionResidente6());
            cs3aux2.setString(23, form3.getsPublicado6());
            cs3aux2.setString(24, form3.getsReferencia6());
            cs3aux2.setString(25, form3.getsNombre7());
            cs3aux2.setString(26, form3.getsNombreTrabajoInvestigacionResidente7());
            cs3aux2.setString(27, form3.getsPublicado7());
            cs3aux2.setString(28, form3.getsReferencia7());
            cs3aux2.setString(29, form3.getsNombre8());
            cs3aux2.setString(30, form3.getsNombreTrabajoInvestigacionResidente8());
            cs3aux2.setString(31, form3.getsPublicado8());
            cs3aux2.setString(32, form3.getsReferencia8());
            cs3aux2.setString(33, form3.getsNombre9());
            cs3aux2.setString(34, form3.getsNombreTrabajoInvestigacionResidente9());
            cs3aux2.setString(35, form3.getsPublicado9());
            cs3aux2.setString(36, form3.getsReferencia9());
            cs3aux2.setString(37, form3.getsNombre0());
            cs3aux2.setString(38, form3.getsNombreTrabajoInvestigacionResidente0());
            cs3aux2.setString(39, form3.getsPublicado0());
            cs3aux2.setString(40, form3.getsReferencia0());
            cs3aux2.setString(41, form3.getsNombreProfesor1());
            cs3aux2.setString(42, form3.getsNombreTrabajoInvestigacion1());
            cs3aux2.setString(43, form3.getsPublicadoProfesor1());
            cs3aux2.setString(44, form3.getsReferenciaProfesor1());
            cs3aux2.setString(45, form3.getsNombreProfesor2());
            cs3aux2.setString(46, form3.getsNombreTrabajoInvestigacion2());
            cs3aux2.setString(47, form3.getsPublicadoProfesor2());
            cs3aux2.setString(48, form3.getsReferenciaProfesor2());
            cs3aux2.setString(49, form3.getsNombreProfesor3());
            cs3aux2.setString(50, form3.getsNombreTrabajoInvestigacion3());
            cs3aux2.setString(51, form3.getsPublicadoProfesor3());
            cs3aux2.setString(52, form3.getsReferenciaProfesor3());
            cs3aux2.setString(53, form3.getsNombreProfesor4());
            cs3aux2.setString(54, form3.getsNombreTrabajoInvestigacion4());
            cs3aux2.setString(55, form3.getsPublicadoProfesor4());
            cs3aux2.setString(56, form3.getsReferenciaProfesor4());
            cs3aux2.setString(57, form3.getsNombreProfesor5());
            cs3aux2.setString(58, form3.getsNombreTrabajoInvestigacion5());
            cs3aux2.setString(59, form3.getsPublicadoProfesor5());
            cs3aux2.setString(60, form3.getsReferenciaProfesor5());
            cs3aux2.setString(61, form3.getsNombreProfesor6());
            cs3aux2.setString(62, form3.getsNombreTrabajoInvestigacion6());
            cs3aux2.setString(63, form3.getsPublicadoProfesor6());
            cs3aux2.setString(64, form3.getsReferenciaProfesor6());
            cs3aux2.setString(65, form3.getsNombreProfesor7());
            cs3aux2.setString(66, form3.getsNombreTrabajoInvestigacion7());
            cs3aux2.setString(67, form3.getsPublicadoProfesor7());
            cs3aux2.setString(68, form3.getsReferenciaProfesor7());
            cs3aux2.setString(69, form3.getsNombreProfesor8());
            cs3aux2.setString(70, form3.getsNombreTrabajoInvestigacion8());
            cs3aux2.setString(71, form3.getsPublicadoProfesor8());
            cs3aux2.setString(72, form3.getsReferenciaProfesor8());
            cs3aux2.setString(73, form3.getsNombreProfesor9());
            cs3aux2.setString(74, form3.getsNombreTrabajoInvestigacion9());
            cs3aux2.setString(75, form3.getsPublicadoProfesor9());
            cs3aux2.setString(76, form3.getsReferenciaProfesor9());
            cs3aux2.setString(77, form3.getsNombreProfesor0());
            cs3aux2.setString(78, form3.getsNombreTrabajoInvestigacion0());
            cs3aux2.setString(79, form3.getsPublicadoProfesor0());
            cs3aux2.setString(80, form3.getsReferenciaProfesor0());

            cs3aux2.execute();

            CallableStatement
            cs3aux3 = conn.prepareCall("{call sp_insercionauxiliar3formulario3(?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");
            
            cs3aux3.setString(1, form3.getsNombreParticipacionProfesor1());
            cs3aux3.setString(2, form3.getsEvento1());
            cs3aux3.setString(3, form3.getsNombreParticipacionProfesor2());
            cs3aux3.setString(4, form3.getsEvento2());
            cs3aux3.setString(5, form3.getsNombreParticipacionProfesor3());
            cs3aux3.setString(6, form3.getsEvento3());
            cs3aux3.setString(7, form3.getsNombreParticipacionProfesor4());
            cs3aux3.setString(8, form3.getsEvento4());
            cs3aux3.setString(9, form3.getsNombreParticipacionProfesor5());
            cs3aux3.setString(10, form3.getsEvento5());
            cs3aux3.setString(11, form3.getsNombreParticipacionProfesor6());
            cs3aux3.setString(12, form3.getsEvento6());
            cs3aux3.setString(13, form3.getsNombreParticipacionProfesor7());
            cs3aux3.setString(14, form3.getsEvento7());
            cs3aux3.setString(15, form3.getsNombreParticipacionProfesor8());
            cs3aux3.setString(16, form3.getsEvento8());
            cs3aux3.setString(17, form3.getsNombreParticipacionProfesor9());
            cs3aux3.setString(18, form3.getsEvento9());
            cs3aux3.setString(19, form3.getsNombreParticipacionProfesor0());
            cs3aux3.setString(20, form3.getsEvento0());
            
            cs3aux3.execute();

            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdFormulario3 FROM Formulario3 WHERE nIdVisita = " + form3.getnIdVisita()) ) {
                rs = smt.getResultSet();

                if( rs.next() ) {
                    form3.setnIdFormulario( rs.getInt(1) );
                }
            }

            if( smt.execute("UPDATE Visitas SET(sEstado) = ('incompletas') WHERE nIdVisita = " + form3.getnIdVisita()) ) {

            }

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean insercionFormulario4(FormularioBean4 form4) {

        boolean exito = false;

        try {
            CallableStatement
            cs4 = conn.prepareCall("{call sp_insercionformulario4(?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, "
                                                               + "?, ?, ?, "
                                                               + "?, ?)}");
            cs4.setInt(1 , form4.getnEnsenanzaTeorica1() );
            cs4.setInt(2 , form4.getnEnsenanzaTeorica2() );
            cs4.setInt(3 , form4.getnEnsenanzaTeorica3() );
            cs4.setInt(4 , form4.getnEnsenanzaTeorica4() );
            cs4.setInt(5 , form4.getnEnsenanzaTeorica5() );
            cs4.setInt(6 , form4.getnEnsenanzaTeorica6() );
            cs4.setInt(7 , form4.getnEnsenanzaTeoricaOtros() );

            cs4.setInt(8 , form4.getnPracticaClinicaSupervision1() );
            cs4.setInt(9 , form4.getnPracticaClinicaSupervision2() );
            cs4.setInt(10, form4.getnPracticaClinicaSupervision3() );
            cs4.setInt(11, form4.getnPracticaClinicaSupervision4() );
            cs4.setInt(12, form4.getnPracticaClinicaSupervision5() );
            cs4.setInt(13, form4.getnPracticaClinicaSupervision6() );
            cs4.setInt(14, form4.getnPracticaClinicaSupervisionOtros() );

            cs4.setInt(15, form4.getnPracticaClinicaSinSupervision1() );
            cs4.setInt(16, form4.getnPracticaClinicaSinSupervision2() );
            cs4.setInt(17, form4.getnPracticaClinicaSinSupervision3() );
            cs4.setInt(18, form4.getnPracticaClinicaSinSupervision4() );
            cs4.setInt(19, form4.getnPracticaClinicaSinSupervision5() );
            cs4.setInt(20, form4.getnPracticaClinicaSinSupervision6() );
            cs4.setInt(21, form4.getnPracticaClinicaSinSupervisionOtros() );

            cs4.setString(22, form4.getsAsignacionTutor() );

            cs4.setInt(23, form4.getnAsistenciaConferencias() );
            cs4.setInt(24, form4.getnAsistenciaSesionesClinicas() );
            cs4.setInt(25, form4.getnAsistenciaSeminarios() );
            cs4.setInt(26, form4.getnMesasRedondas() );
            cs4.setInt(27, form4.getnSesionesBiograficas() );
            cs4.setInt(28, form4.getnTalleres() );
            cs4.setInt(29, form4.getnOtrasActividades() );

            cs4.setInt(30, form4.getnGuardiasSupervision1() );
            cs4.setInt(31, form4.getnGuardiasSupervision2() );
            cs4.setInt(32, form4.getnGuardiasSupervision3() );
            cs4.setInt(33, form4.getnGuardiasSupervision4() );
            cs4.setInt(34, form4.getnGuardiasSupervision5() );
            cs4.setInt(35, form4.getnGuardiasSupervision6() );
            cs4.setInt(36, form4.getnGuardiasSupervisionOtros() );

            cs4.setInt(37, form4.getnGuardiasSinSupervision1() );
            cs4.setInt(38, form4.getnGuardiasSinSupervision2() );
            cs4.setInt(39, form4.getnGuardiasSinSupervision3() );
            cs4.setInt(40, form4.getnGuardiasSinSupervision4() );
            cs4.setInt(41, form4.getnGuardiasSinSupervision5() );
            cs4.setInt(42, form4.getnGuardiasSinSupervision6() );
            cs4.setInt(43, form4.getnGuardiasSinSupervisionOtros() );

            cs4.setString(44, form4.getsAreasDescanso() );
            cs4.setString(45, form4.getsSanitariosPropios() );

            cs4.setString(46, form4.getsCondicionesAreas() );
            cs4.setString(47, form4.getsConocimientosPrevios() );
            cs4.setString(48, form4.getsPercepcionProcesoEnseApren() );

            cs4.setString(49, form4.getsComentPercepcionProcesoEnseApren() );
            cs4.setInt(50, form4.getnIdVisita());

            cs4.execute();

            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdFormulario4 FROM Formulario4 WHERE nIdVisita = " + form4.getnIdVisita()) ) {
                rs = smt.getResultSet();

                if( rs.next() ) {
                    form4.setnIdFormulario( rs.getInt(1) );
                }
            }

            if( smt.execute("UPDATE Visitas SET(sEstado) = ('incompletas') WHERE nIdVisita = " + form4.getnIdVisita()) ) {

            }

            exito = true;

        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean insercionFormulario5(FormularioBean5 form5) {

        boolean exito = false;

        try {
            CallableStatement
            cs5 = conn.prepareCall("{call sp_insercionformulario5(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");
            cs5.setString(1 , form5.getsPeliculasVideocintas());
            cs5.setString(2 , form5.getsGrabacionesAudio());
            cs5.setString(3 , form5.getsModelosPiezasMuseo());
            cs5.setString(4 , form5.getsProgramasComputarizados());
            cs5.setString(5 , form5.getsOtroMaterialDidactico());
            cs5.setString(6 , form5.getsEspecificacionMaterialDidactico());
            cs5.setString(7 , form5.getsCanonesProyeccion());
            cs5.setString(8 , form5.getsMonitoresTv());
            cs5.setString(9 , form5.getsVideocasseteras());
            cs5.setString(10 , form5.getsComputadoras());
            cs5.setString(11, form5.getsOtroAudiovisual());
            cs5.setString(12, form5.getsEspecificacionAudiovisual());
            cs5.setString(13, form5.getsAccesoComputo());
            cs5.setString(14, form5.getsExpedienteElectronico());
            cs5.setString(15, form5.getsSalaJuntas());
            cs5.setInt(16, form5.getnNumeroSalas());
            cs5.setInt(17, form5.getnCapacidadSalas());
            cs5.setString(18, form5.getsAulasCurso());
            cs5.setInt(19, form5.getnNumeroAulasCurso());
            cs5.setInt(20, form5.getnCapacidadAulasCurso());
            cs5.setString(21,form5.getsAuditorios());
            cs5.setInt(22, form5.getnNumeroAuditorios());
            cs5.setInt(23, form5.getnCapacidadAuditorios());
            cs5.setString(24, form5.getsBibliohemeroteca());
            cs5.setString(25, form5.getsAccesoBibliotecasDigitales());
            cs5.setString(26, form5.getsBibliotecaDigitalInstitucion());
            cs5.setString(27, form5.getsBibliotecaDigitalUNAM());
            cs5.setString(28, form5.getsBibliotecaDigitalOtras());
            cs5.setString(29, form5.getsFotocopiado());
            cs5.setString(30, form5.getsBusquedaInformacion());
            cs5.setString(31, form5.getsAccesoInternetNodos());
            cs5.setString(32, form5.getsAccesoInternetInalambrico());
            cs5.setString(33, form5.getsWifiSoloBiblioteca());
            cs5.setString(34, form5.getsWifiDiversosSitiosHospital());
            cs5.setString(35, form5.getsWifiTodoHospital());
            cs5.setString(36, form5.getsDiseminacionInformacion());
            cs5.setString(37, form5.getsPrestamosInterbibliotecarios());
            cs5.setString(38, form5.getsPrestamosDomicilio());
            cs5.setString(39, form5.getsOtrosServiciosBibliohemeroteca());
            cs5.setString(40, form5.getsEspecificacionServiciosBibliohemeroteca());
            cs5.setString(41, form5.getsSubsidioPersonal());
            cs5.setInt(42, form5.getnIdVisita());

            cs5.execute();

            CallableStatement
            cs5Aux = conn.prepareCall("{call sp_insercionauxiliarformulario5(?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");
            cs5Aux.setString(1 , form5.getsNombreRevistaNac1());
            cs5Aux.setString(2 , form5.getsNombreRevistaNac2());
            cs5Aux.setString(3 , form5.getsNombreRevistaNac3());
            cs5Aux.setString(4 , form5.getsNombreRevistaNac4());
            cs5Aux.setString(5 , form5.getsNombreRevistaNac5());
            cs5Aux.setString(6 , form5.getsNombreRevistaNac6());
            cs5Aux.setString(7 , form5.getsNombreRevistaNac7());
            cs5Aux.setString(8 , form5.getsNombreRevistaNac8());
            cs5Aux.setString(9 , form5.getsNombreRevistaNac9());
            cs5Aux.setString(10, form5.getsNombreRevistaNac0());
            cs5Aux.setString(11, form5.getsNombreRevistaEx1());
            cs5Aux.setString(12, form5.getsNombreRevistaEx2());
            cs5Aux.setString(13, form5.getsNombreRevistaEx3());
            cs5Aux.setString(14, form5.getsNombreRevistaEx4());
            cs5Aux.setString(15, form5.getsNombreRevistaEx5());
            cs5Aux.setString(16, form5.getsNombreRevistaEx6());
            cs5Aux.setString(17, form5.getsNombreRevistaEx7());
            cs5Aux.setString(18, form5.getsNombreRevistaEx8());
            cs5Aux.setString(19, form5.getsNombreRevistaEx9());
            cs5Aux.setString(20, form5.getsNombreRevistaEx0());

            cs5Aux.execute();

            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdFormulario5 FROM Formulario5 WHERE nIdVisita = " + form5.getnIdVisita()) ) {
                rs = smt.getResultSet();

                if( rs.next() ) {
                    form5.setnIdFormulario( rs.getInt(1) );
                }
            }

            if( smt.execute("UPDATE Visitas SET(sEstado) = ('incompletas') WHERE nIdVisita = " + form5.getnIdVisita()) ) {

            }

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean insercionFormulario6(FormularioBean6 form6) {

        boolean exito = false;

        try {
            CallableStatement
            cs6 = conn.prepareCall("{call sp_insercionFormulario6(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");
            cs6.setString(1 , form6.getsBecasInstitucionNacionales());
            cs6.setInt(2, form6.getnNumeroBecasNacionales());
            cs6.setString(3 , form6.getsBecasInstitucionExtranjeros());
            cs6.setInt(4, form6.getnNumeroBecasExtranjeros());
            cs6.setInt(5, form6.getnR1Nac());
            cs6.setInt(6, form6.getnR2Nac());
            cs6.setInt(7, form6.getnR3Nac());
            cs6.setInt(8, form6.getnR4Nac());
            cs6.setInt(9, form6.getnR5Nac());
            cs6.setInt(10, form6.getnR6Nac());
            cs6.setInt(11, form6.getnOtrosNac());
            form6.setnTotalNac(0);
            cs6.setInt(12, form6.getnTotalNac());
            cs6.setInt(13, form6.getnR1Ex());
            cs6.setInt(14, form6.getnR2Ex());
            cs6.setInt(15, form6.getnR3Ex());
            cs6.setInt(16, form6.getnR4Ex());
            cs6.setInt(17, form6.getnR5Ex());
            cs6.setInt(18, form6.getnR6Ex());
            cs6.setInt(19, form6.getnOtrosEx());
            form6.setnTotalEx(0);
            cs6.setInt(20, form6.getnTotalEx());
            cs6.setInt(21, form6.getnIdVisita());

            cs6.execute();

            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdFormulario6 FROM Formulario6 WHERE nIdVisita = " + form6.getnIdVisita()) ) {
                rs = smt.getResultSet();

                if( rs.next() ) {
                    form6.setnIdFormulario( rs.getInt(1) );
                }
            }

            if( smt.execute("UPDATE Visitas SET(sEstado) = ('incompletas') WHERE nIdVisita = " + form6.getnIdVisita()) ) {

            }

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean insercionFormulario7(FormularioBean7 form7) {

        boolean exito = false;

        try {
            CallableStatement
            cs7 = conn.prepareCall("{call sp_insercionformulario7(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?)}");
            cs7.setString(1 , form7.getsProblemaDiagnostico1());
            cs7.setString(2 , form7.getsManejoPacientes1());
            cs7.setString(3 , form7.getsProcedimientosDiagnostico1());
            cs7.setString(4 , form7.getsParticipacionIntervencion1());
            cs7.setString(5 , form7.getsPacientesCargo1());
            cs7.setString(6 , form7.getsActividadesServicio1());
            cs7.setString(7 , form7.getsActividadesInvestigacion1());
            cs7.setString(8 , form7.getsProblemaDiagnostico2());
            cs7.setString(9 , form7.getsManejoPacientes2());
            cs7.setString(10, form7.getsProcedimientosDiagnostico2());
            cs7.setString(11, form7.getsParticipacionIntervencion2());
            cs7.setString(12, form7.getsPacientesCargo2());
            cs7.setString(13, form7.getsActividadesServicio2());
            cs7.setString(14, form7.getsActividadesInvestigacion2());
            cs7.setString(15 , form7.getsProblemaDiagnostico3());
            cs7.setString(16, form7.getsManejoPacientes3());
            cs7.setString(17, form7.getsProcedimientosDiagnostico3());
            cs7.setString(18, form7.getsParticipacionIntervencion3());
            cs7.setString(19, form7.getsPacientesCargo3());
            cs7.setString(20, form7.getsActividadesServicio3());
            cs7.setString(21, form7.getsActividadesInvestigacion3());
            cs7.setString(22, form7.getsProblemaDiagnostico4());
            cs7.setString(23, form7.getsManejoPacientes4());
            cs7.setString(24, form7.getsProcedimientosDiagnostico4());
            cs7.setString(25, form7.getsParticipacionIntervencion4());
            cs7.setString(26, form7.getsPacientesCargo4());
            cs7.setString(27, form7.getsActividadesServicio4());
            cs7.setString(28, form7.getsActividadesInvestigacion4());
            cs7.setString(29, form7.getsProblemaDiagnostico5());
            cs7.setString(30, form7.getsManejoPacientes5());
            cs7.setString(31, form7.getsProcedimientosDiagnostico5());
            cs7.setString(32, form7.getsParticipacionIntervencion5());
            cs7.setString(33, form7.getsPacientesCargo5());
            cs7.setString(34, form7.getsActividadesServicio5());
            cs7.setString(35, form7.getsActividadesInvestigacion5());
            cs7.setString(36, form7.getsProblemaDiagnostico6());
            cs7.setString(37, form7.getsManejoPacientes6());
            cs7.setString(38, form7.getsProcedimientosDiagnostico6());
            cs7.setString(39, form7.getsParticipacionIntervencion6());
            cs7.setString(40, form7.getsPacientesCargo6());
            cs7.setString(41, form7.getsActividadesServicio6());
            cs7.setString(42, form7.getsActividadesInvestigacion6());
            cs7.setString(43, form7.getsProblemaDiagnosticoOtros());
            cs7.setString(44, form7.getsManejoPacientesOtros());
            cs7.setString(45, form7.getsProcedimientosDiagnosticoOtros());
            cs7.setString(46, form7.getsParticipacionIntervencionOtros());
            cs7.setString(47, form7.getsPacientesCargoOtros());
            cs7.setString(48, form7.getsActividadesServicioOtros());
            cs7.setString(49, form7.getsActividadesInvestigacionOtros());
            cs7.setInt(50, form7.getnIdVisita());

            cs7.execute();

            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdFormulario7 FROM Formulario7 WHERE nIdVisita = " + form7.getnIdVisita()) ) {
                rs = smt.getResultSet();

                if( rs.next() ) {
                    form7.setnIdFormulario( rs.getInt(1) );
                }
            }

            if( smt.execute("UPDATE Visitas SET(sEstado) = ('incompletas') WHERE nIdVisita = " + form7.getnIdVisita()) ) {

            }

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean insercionFormulario8(FormularioBean8 form8) {

        boolean exito = false;

        try {
            CallableStatement
            cs8 = conn.prepareCall("{call sp_insercionformulario8(?, ?, ?)}");
            cs8.setString(1 , form8.getsConocimientosMedicos());
            cs8.setString(2 , form8.getsDestrezas() );
            cs8.setInt(3, form8.getnIdVisita());

            cs8.execute();

            ResultSet rs;
            Statement smt = conn.createStatement();

            if( smt.execute("SELECT nIdFormulario8 FROM Formulario8 WHERE nIdVisita = " + form8.getnIdVisita()) ) {
                rs = smt.getResultSet();

                if( rs.next() ) {
                    form8.setnIdFormulario( rs.getInt(1) );
                }
            }

            if( smt.execute("UPDATE Visitas SET(sEstado) = ('incompletas') WHERE nIdVisita = " + form8.getnIdVisita()) ) {

            }

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean busquedaFormulario1(FormularioBean1 form1) {

        boolean exito = false;

        try {
            ResultSet rs;
            Statement cs1 = conn.createStatement();

            if( cs1.execute("SELECT nIdFormulario1 FROM Formulario1 WHERE nIdVisita = " + form1.getnIdVisita() ) ) {
                rs = cs1.getResultSet();

                if( rs.next() ) {
                    form1.setnIdFormulario( rs.getInt(1) );
                }
                else {
                    return false;
                }
            }

            if( cs1.execute("SELECT * FROM sp_buscadatosformulario1(" + form1.getnIdFormulario() + ")") ) {
                rs = cs1.getResultSet();

                if( rs.next() ) {
                    form1.setnEspecialistasMatutino( rs.getInt(13) );
                    form1.setnEspecialistasVespertino( rs.getInt(14) );
                    form1.setnEspecialistasNocturno( rs.getInt(15) );
                    form1.setnEspecialistasFinesSemana( rs.getInt(16) );

                    form1.setnCamasAdultos( rs.getInt(17) );
                    form1.setnCamasNinos( rs.getInt(18) );
                    form1.setnCunas( rs.getInt(19) );
                    form1.setnIncubadoras( rs.getInt(20) );
                    form1.setsOtrasCensables( rs.getString(21) );
                    form1.setnOtrasCensables( rs.getInt(22) );
                    form1.setsEspecificacionCensables( rs.getString(23) );

                    form1.setnUrgencias( rs.getInt(24) );
                    form1.setnTerapiaIntensiva( rs.getInt(25) );
                    form1.setnTerapiaIntermedia( rs.getInt(26) );
                    form1.setnCirugiaAmbulatoria( rs.getInt(27) );
                    form1.setnLaboratorioGabinete( rs.getInt(28) );
                    form1.setnCunasNeonatosSanos( rs.getInt(29) );
                    form1.setnCamasRecuperacionQuirofano( rs.getInt(30) );
                    form1.setnTrabajoParto( rs.getInt(31) );
                    form1.setsOtrasNoCensables( rs.getString(32) );
                    form1.setnOtrasNoCensables( rs.getInt(33) );
                    form1.setsEspecificacionNoCensables( rs.getString(34) );

                    form1.setsQuirofanos( rs.getString(35) );
                    form1.setnQuirofanos( rs.getInt(36) );
                    form1.setsSalasExpulsion( rs.getString(37) );
                    form1.setnSalasExpulsion( rs.getInt(38) );
                    form1.setsConsultaExterna( rs.getString(39) );
                    form1.setnConsultaExterna( rs.getInt(40) );
                    form1.setsSistemaRegistroCodificacion( rs.getString(41) );
                    form1.setnSistemaRegistroCodificacion( rs.getInt(42) );
                    form1.setsManualNormasProcedimientos( rs.getString(43) );
                    form1.setnManualNormasProcedimientos( rs.getInt(44) );
                    form1.setsArchivoMaterialDidactico( rs.getString(45) );
                    form1.setnArchivoMaterialDidactico( rs.getInt(46) );

                    form1.setsLaboratorioRutina( rs.getString(47) );
                    form1.setsCondicionesLaboratorioRutina( rs.getString(48) );
                    form1.setsComentariosLaboratorioRutina( rs.getString(49) );
                    form1.setsLaboratoriosEspeciales( rs.getString(50) );
                    form1.setsEspecificacionLaboratoriosEspeciales( rs.getString(51) );
                    form1.setsCondicionesLaboratoriosEspeciales( rs.getString(52) );
                    form1.setsComentarioLaboratoriosEspeciales( rs.getString(53) );
                    form1.setsGabinetes( rs.getString(54) );
                    form1.setsEspecificacionGabinetes( rs.getString(55) );
                    form1.setsCondicionGabinetes( rs.getString(56) );
                    form1.setsComentariosGabinetes( rs.getString(57) );
                    form1.setsOtrosDiagnosticoTratamiento( rs.getString(58) );
                    form1.setsEspecificacionOtrosDiagnosticoTratamiento( rs.getString(59) );
                    form1.setsCondicionesOtrosDiagnosticoTratamiento( rs.getString(60) );
                    form1.setsComentarioOtrosDiagnosticoTratamiento( rs.getString(61) );

                    form1.setsComiteMorbilidad( rs.getString(62) );
                    form1.setsComiteMortalidad( rs.getString(63) );
                    form1.setsComiteInfecciones( rs.getString(64) );
                    form1.setsComiteExpedienteClinico( rs.getString(65) );
                    form1.setsComiteBioeticaEtica( rs.getString(66) );
                    form1.setsComiteAuditoriaMedica( rs.getString(67) );
                    form1.setsComiteEnsenanza( rs.getString(68) );
                    form1.setsComiteBioseguridad( rs.getString(69) );
                    form1.setsComiteCientifico( rs.getString(70) );
                    form1.setsOtrosComites( rs.getString(71) );

                    form1.setsEspecificacionOtrosComites( rs.getString(72) );
                    form1.setnIdVisita( rs.getInt(73) );
                    form1.setnIdHospital( rs.getInt(74) );
                    form1.setnIdCurso( rs.getInt(75) );
                }
            }

            if( cs1.execute("SELECT * FROM sp_buscaDatosFormulario1aux0( " + form1.getnIdFormulario() + ")") ) {
                rs = cs1.getResultSet();

                if( rs.next() ) {
                    form1.setsProfesor1( rs.getString(1) );
                    form1.setsNombramiento1( rs.getString(2) );
                    form1.setsGrado1( rs.getString(3) );
                    form1.setnAntiguedad1( rs.getInt(4) );
                    form1.setsCursos1( rs.getString(5) );
                    form1.setsCertificado1( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor2( rs.getString(1) );
                    form1.setsNombramiento2( rs.getString(2) );
                    form1.setsGrado2( rs.getString(3) );
                    form1.setnAntiguedad2( rs.getInt(4) );
                    form1.setsCursos2( rs.getString(5) );
                    form1.setsCertificado2( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor3( rs.getString(1) );
                    form1.setsNombramiento3( rs.getString(2) );
                    form1.setsGrado3( rs.getString(3) );
                    form1.setnAntiguedad3( rs.getInt(4) );
                    form1.setsCursos3( rs.getString(5) );
                    form1.setsCertificado3( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor4( rs.getString(1) );
                    form1.setsNombramiento4( rs.getString(2) );
                    form1.setsGrado4( rs.getString(3) );
                    form1.setnAntiguedad4( rs.getInt(4) );
                    form1.setsCursos4( rs.getString(5) );
                    form1.setsCertificado4( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor5( rs.getString(1) );
                    form1.setsNombramiento5( rs.getString(2) );
                    form1.setsGrado5( rs.getString(3) );
                    form1.setnAntiguedad5( rs.getInt(4) );
                    form1.setsCursos5( rs.getString(5) );
                    form1.setsCertificado5( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor6( rs.getString(1) );
                    form1.setsNombramiento6( rs.getString(2) );
                    form1.setsGrado6( rs.getString(3) );
                    form1.setnAntiguedad6( rs.getInt(4) );
                    form1.setsCursos6( rs.getString(5) );
                    form1.setsCertificado6( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor7( rs.getString(1) );
                    form1.setsNombramiento7( rs.getString(2) );
                    form1.setsGrado7( rs.getString(3) );
                    form1.setnAntiguedad7( rs.getInt(4) );
                    form1.setsCursos7( rs.getString(5) );
                    form1.setsCertificado7( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor8( rs.getString(1) );
                    form1.setsNombramiento8( rs.getString(2) );
                    form1.setsGrado8( rs.getString(3) );
                    form1.setnAntiguedad8( rs.getInt(4) );
                    form1.setsCursos8( rs.getString(5) );
                    form1.setsCertificado8( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor9( rs.getString(1) );
                    form1.setsNombramiento9( rs.getString(2) );
                    form1.setsGrado9( rs.getString(3) );
                    form1.setnAntiguedad9( rs.getInt(4) );
                    form1.setsCursos9( rs.getString(5) );
                    form1.setsCertificado9( rs.getString(6) );
                }
                if( rs.next() ) {
                    form1.setsProfesor0( rs.getString(1) );
                    form1.setsNombramiento0( rs.getString(2) );
                    form1.setsGrado0( rs.getString(3) );
                    form1.setnAntiguedad0( rs.getInt(4) );
                    form1.setsCursos0( rs.getString(5) );
                    form1.setsCertificado0( rs.getString(6) );
                }

                exito = true;
            }

        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean busquedaFormulario2(FormularioBean2 form2) {

        boolean exito = false;

        try {
            ResultSet rs;
            Statement cs2 = conn.createStatement();

            if( cs2.execute("SELECT nIdFormulario2 FROM Formulario2 WHERE nIdVisita = " + form2.getnIdVisita() ) ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {
                    form2.setnIdFormulario( rs.getInt(1) );
                }
                else {
                    return false;
                }
            }

            if( cs2.execute("SELECT * FROM sp_buscadatosformulario2(" + form2.getnIdFormulario() + ")") ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {

                    form2.setnPromedioMensualConsultasExternas(rs.getInt(1));
                    form2.setnAltasMejoriaCuracion(rs.getInt(2));
                    form2.setnAltaDefuncion(rs.getInt(3));
                    form2.setnPromedioMensualIntervenciones(rs.getInt(4));
                    form2.setnPromedioMensualPartosAtendidos(rs.getInt(5));
                    form2.setnAutopsias(rs.getInt(6));
                    form2.setnBiopsias(rs.getInt(7));
                    form2.setnCitologias(rs.getInt(8));
                    form2.setnIdVisita( rs.getInt(9) );

                }

            }

            if( cs2.execute("SELECT * FROM sp_buscadatosformulario2aux0(" + form2.getnIdFormulario() + ")") ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {

                    form2.setsNombreCo1(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo2(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo3(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo4(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo5(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo6(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo7(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo8(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo9(rs.getString(1));
                    rs.next();
                    form2.setsNombreCo0(rs.getString(1));
                }
            }

            if( cs2.execute("SELECT * FROM sp_buscadatosformulario2aux1(" + form2.getnIdFormulario() + ")") ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {

                    form2.setsNombreCh1(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh2(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh3(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh4(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh5(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh6(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh7(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh8(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh9(rs.getString(1));
                    rs.next();
                    form2.setsNombreCh0(rs.getString(1));
                }
            }

            if( cs2.execute("SELECT * FROM sp_buscadatosformulario2aux2(" + form2.getnIdFormulario() + ")") ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {

                    form2.setsNombreP1(rs.getString(1));
                    rs.next();
                    form2.setsNombreP2(rs.getString(1));
                    rs.next();
                    form2.setsNombreP3(rs.getString(1));
                    rs.next();
                    form2.setsNombreP4(rs.getString(1));
                    rs.next();
                    form2.setsNombreP5(rs.getString(1));
                    rs.next();
                    form2.setsNombreP6(rs.getString(1));
                    rs.next();
                    form2.setsNombreP7(rs.getString(1));
                    rs.next();
                    form2.setsNombreP8(rs.getString(1));
                    rs.next();
                    form2.setsNombreP9(rs.getString(1));
                    rs.next();
                    form2.setsNombreP0(rs.getString(1));
                }
            }

            if( cs2.execute("SELECT * FROM sp_buscadatosformulario2aux3(" + form2.getnIdFormulario() + ")") ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {

                    form2.setsNombreCom1(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom2(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom3(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom4(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom5(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom6(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom7(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom8(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom9(rs.getString(1));
                    rs.next();
                    form2.setsNombreCom0(rs.getString(1));
                }
            }

            if( cs2.execute("SELECT * FROM sp_buscadatosformulario2aux4(" + form2.getnIdFormulario() + ")") ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {

                    form2.setsNombreElab1(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab2(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab3(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab4(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab5(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab6(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab7(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab8(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab9(rs.getString(1));
                    rs.next();
                    form2.setsNombreElab0(rs.getString(1));
                }
            }

            if( cs2.execute("SELECT * FROM sp_buscadatosformulario2aux5(" + form2.getnIdFormulario() + ")") ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {

                    form2.setsNombreEg1(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg2(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg3(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg4(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg5(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg6(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg7(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg8(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg9(rs.getString(1));
                    rs.next();
                    form2.setsNombreEg0(rs.getString(1));
                }
            }

            if( cs2.execute("SELECT * FROM sp_buscadatosformulario2aux6(" + form2.getnIdFormulario() + ")") ) {
                rs = cs2.getResultSet();

                if( rs.next() ) {

                    form2.setsNombrePi1(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi2(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi3(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi4(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi5(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi6(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi7(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi8(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi9(rs.getString(1));
                    rs.next();
                    form2.setsNombrePi0(rs.getString(1));

                    exito = true;
                }
            }

        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean busquedaFormulario3(FormularioBean3 form3) {
        boolean exito = false;
        try {
            ResultSet rs;
            Statement cs3 = conn.createStatement();

            if( cs3.execute("SELECT nIdFormulario3 FROM Formulario3 WHERE nIdVisita = " + form3.getnIdVisita() ) ) {
                rs = cs3.getResultSet();

                if( rs.next() ) {
                    form3.setnIdFormulario( rs.getInt(1) );
                }
                else {
                    return false;
                }
            }

            if( cs3.execute("SELECT * FROM sp_buscaDatosFormulario3(" + form3.getnIdFormulario() + ")") ) {
                rs = cs3.getResultSet();
                if(rs.next()){
                    form3.setsPromedioMinimo(rs.getString (1));
                    form3.setnEspecificarPromedioMinimo(rs.getInt (2));
                    form3.setsExamenNacionalResidencias(rs.getString(3));
                    form3.setsExamenCompetenciaAcademicaUNAM(rs.getString(4));
                    form3.setsExamenTeoricoConocimientos(rs.getString(5));
                    form3.setsResidenciaRotatoria(rs.getString(6));
                    form3.setsExamenPsicometrico(rs.getString(7));
                    form3.setsExamenIngles(rs.getString(8));
                    form3.setsExamenPracticoDestrezas(rs.getString(9));
                    form3.setsExamenSaludFisica(rs.getString(10));
                    form3.setsEntrevistaPersonal(rs.getString(11));
                    form3.setsAntecedentesInstitucionSalud(rs.getString(12));
                    form3.setsEdadMaxima(rs.getString(13));
                    form3.setnEspecificacionEdadMaxima(rs.getInt(14));
                    form3.setsEstudiosPreviosOtraEspecialidad(rs.getString(15));
                    form3.setsOtroCriterioAdmision(rs.getString(16));
                    form3.setsEspecificarCriterioAdmision(rs.getString(17));
                    form3.setnDuracionCurso(rs.getInt(18));
                    form3.setsEstudiosPreviosOtraEspecialidadMedica(rs.getString(19));
                    form3.setnDuracionOtraEspecialidad(rs.getInt(20));
                    form3.setsEspecificacionOtraEspecialidad(rs.getString(21));
                    form3.setsResidenciaSoloUnidad(rs.getString(22));
                    form3.setsUnidadesComplementarias(rs.getString(23));
                    form3.setsPorObjetivos(rs.getString(24));
                    form3.setsProgramaOperativo(rs.getString(25));
                    form3.setsListadoTemas(rs.getString(26));
                    form3.setsCartaDescriptiva(rs.getString(27));
                    form3.setsProgramaRotacion(rs.getString(28));
                    form3.setsModular(rs.getString(29));
                    form3.setsAsignatura(rs.getString(30));
                    form3.setsPorAnos(rs.getString(31));
                    form3.setsPorSemestres(rs.getString(32));
                    form3.setsOtraCaracteristica(rs.getString(33));
                    form3.setsEspecificacionOtras(rs.getString(34));
                    form3.setsAlumnosResidenciasFormales(rs.getString(35));
                    form3.setnActividadesTeoricasGrupo(rs.getInt(36));
                    form3.setnActividadesTeoricasIndependientes(rs.getInt(37));
                    form3.setnPracticaClinicaIndependiente(rs.getInt(38));
                    form3.setnPracticaClinicaTutoria(rs.getInt(39));
                    form3.setnActivadadesInvestigacion(rs.getInt(40));
                    form3.setnActualizacion(rs.getInt(41));
                    form3.setnAplicacion(rs.getInt(42));
                    form3.setnGeneracion(rs.getInt(43));
                    form3.setnDesarrolloAutonomia(rs.getInt(44));
                    form3.setnDesarrolloCapacidades(rs.getInt(45));
                    form3.setsSituacionesDesarrolloDestrezas(rs.getString(46));
                    form3.setsSituacionesGraduacionDestrezas(rs.getString(47));
                    form3.setsEnsenanzaDestrezasResidentes(rs.getString(48));
                    form3.setsEnsenanzaDestrezasProfesores(rs.getString(49));
                    form3.setsSupervisionDominio(rs.getString(50));
                    form3.setsProgramanActividades(rs.getString(51));
                    form3.setsExamenTeoricoOral(rs.getString(52));
                    form3.setsPeriodicidadExamenTeoricoOral(rs.getString(53));
                    form3.setsExamenTeoricoEscrito(rs.getString(54));
                    form3.setsPeriodicidadExamenTeoricoEscrito(rs.getString(55));
                    form3.setsExamenPractico(rs.getString(56));
                    form3.setsPeriodicidadExamenPractico(rs.getString(57));
                    form3.setsListasCotejo(rs.getString(58));
                    form3.setsObservacionLibre(rs.getString(59));
                    form3.setsGuiaObservacion(rs.getString(60));
                    form3.setsEscalasEvaluativas(rs.getString(61));
                    form3.setsOtroProcedimiento(rs.getString(62));
                    form3.setsEspecificarOtroProcedimiento(rs.getString(63));
                    form3.setsRetroalimentacion(rs.getString(64));
                    form3.setsPeriodicidadProgramaOperativo(rs.getString(65));
                    form3.setsAlumnosEnDepartamentales(rs.getString(66));
                    form3.setnPorcentajeDepartamental(rs.getInt(67));
                    form3.setnSeminarioAtencionMedica(rs.getInt(68));
                    form3.setnTrabajoAtencionMedica(rs.getInt(69));
                    form3.setnSeminarioInvestigacion(rs.getInt(70));
                    form3.setnSeminarioEducacion(rs.getInt(71));
                    form3.setsDificultades(rs.getString(72));
                    form3.setsEspecificacionDificultades(rs.getString(73));
                    form3.setsPercepcionEstres(rs.getString(74));
                    form3.setsComentariosPercepcionesEstres(rs.getString(75));
                    form3.setnIdVisita( rs.getInt(76) );
                }

            }

            if( cs3.execute("SELECT * FROM sp_buscaDatosFormulario3aux0(" + form3.getnIdFormulario() + ")") ) {
                rs = cs3.getResultSet();
                if(rs.next()){
                    form3.setsAreaRotacionPropia1(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia1(rs.getInt(2));

                }

                if(rs.next()){
                    form3.setsAreaRotacionPropia2(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia2(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionPropia3(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia3(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionPropia4(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia4(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionPropia5(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia5(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionPropia6(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia6(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionPropia7(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia7(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionPropia8(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia8(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionPropia9(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia9(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionPropia0(rs.getString(1));
                    form3.setnTiempoAreaRotacionPropia0(rs.getInt(2));

                }
                exito = true;
            }

            if( cs3.execute("SELECT * FROM sp_buscaDatosFormulario3aux1(" + form3.getnIdFormulario() + ")") ) {
                rs = cs3.getResultSet();
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria1(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria1(rs.getInt(2));

                }

                if(rs.next()){
                    form3.setsAreaRotacionComplementaria2(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria2(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria3(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria3(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria4(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria4(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria5(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria5(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria6(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria6(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria7(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria7(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria8(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria8(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria9(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria9(rs.getInt(2));

                }
                if(rs.next()){
                    form3.setsAreaRotacionComplementaria0(rs.getString(1));
                    form3.setnTiempoAreaRotacionComplementaria0(rs.getInt(2));

                }
                exito = true;
            }

            if( cs3.execute("SELECT * FROM sp_buscaDatosFormulario3aux2(" + form3.getnIdFormulario() + ")") ) {
                rs = cs3.getResultSet();
                if(rs.next()){
                    form3.setsAreaSubsede1(rs.getString(1));
                    form3.setnTiempoSubsede1(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede2(rs.getString(1));
                    form3.setnTiempoSubsede2(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede3(rs.getString(1));
                    form3.setnTiempoSubsede3(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede4(rs.getString(1));
                    form3.setnTiempoSubsede4(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede5(rs.getString(1));
                    form3.setnTiempoSubsede5(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede6(rs.getString(1));
                    form3.setnTiempoSubsede6(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede7(rs.getString(1));
                    form3.setnTiempoSubsede7(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede8(rs.getString(1));
                    form3.setnTiempoSubsede8(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede9(rs.getString(1));
                    form3.setnTiempoSubsede9(rs.getInt(2));
                }

                 if(rs.next()){
                    form3.setsAreaSubsede0(rs.getString(1));
                    form3.setnTiempoSubsede0(rs.getInt(2));
                }
                exito = true;
            }

            if( cs3.execute("SELECT * FROM sp_buscaDatosFormulario3aux3(" + form3.getnIdFormulario() + ")") ) {
                rs = cs3.getResultSet();
                if(rs.next()){
                    form3.setnExternoR1(rs.getInt(1));
                    form3.setnExternoR2(rs.getInt(2));
                    form3.setnExternoR3(rs.getInt(3));
                    form3.setnExternoR4(rs.getInt(4));
                    form3.setnExternoR5(rs.getInt(5));
                    form3.setnExternoR6(rs.getInt(6));
                    form3.setnExternoOtros(rs.getInt(7));
                }
                exito = true;
            }

            if( cs3.execute("SELECT * FROM sp_buscaDatosFormulario3aux4(" + form3.getnIdFormulario() + ")") ) {
                rs = cs3.getResultSet();
                if(rs.next()){
                   form3.setsNombre1(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente1(rs.getString(2));
                   form3.setsPublicado1(rs.getString(3));
                   form3.setsReferencia1(rs.getString(4));
                }

            if(rs.next()){
                   form3.setsNombre2(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente2(rs.getString(2));
                   form3.setsPublicado2(rs.getString(3));
                   form3.setsReferencia2(rs.getString(4));
                }
            if(rs.next()){
                   form3.setsNombre3(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente3(rs.getString(2));
                   form3.setsPublicado3(rs.getString(3));
                   form3.setsReferencia3(rs.getString(4));
                }
            if(rs.next()){
                   form3.setsNombre4(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente4(rs.getString(2));
                   form3.setsPublicado4(rs.getString(3));
                   form3.setsReferencia4(rs.getString(4));
                }
            if(rs.next()){
                   form3.setsNombre5(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente5(rs.getString(2));
                   form3.setsPublicado5(rs.getString(3));
                   form3.setsReferencia5(rs.getString(4));
                }
            if(rs.next()){
                   form3.setsNombre6(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente6(rs.getString(2));
                   form3.setsPublicado6(rs.getString(3));
                   form3.setsReferencia6(rs.getString(4));
                }
            if(rs.next()){
                   form3.setsNombre7(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente7(rs.getString(2));
                   form3.setsPublicado7(rs.getString(3));
                   form3.setsReferencia7(rs.getString(4));
                }
            if(rs.next()){
                   form3.setsNombre8(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente8(rs.getString(2));
                   form3.setsPublicado8(rs.getString(3));
                   form3.setsReferencia8(rs.getString(4));
                }
            if(rs.next()){
                   form3.setsNombre9(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente9(rs.getString(2));
                   form3.setsPublicado9(rs.getString(3));
                   form3.setsReferencia9(rs.getString(4));
                }
            if(rs.next()){
                   form3.setsNombre0(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacionResidente0(rs.getString(2));
                   form3.setsPublicado0(rs.getString(3));
                   form3.setsReferencia0(rs.getString(4));
                }
                exito = true;
            }

             if( cs3.execute("SELECT * FROM sp_buscaDatosFormulario3aux5(" + form3.getnIdFormulario() + ")") ) {
                rs = cs3.getResultSet();
                if(rs.next()){
                   form3.setsNombreProfesor1(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion1(rs.getString(2));
                   form3.setsPublicadoProfesor1(rs.getString(3));
                   form3.setsReferenciaProfesor1(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor2(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion2(rs.getString(2));
                   form3.setsPublicadoProfesor2(rs.getString(3));
                   form3.setsReferenciaProfesor2(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor3(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion3(rs.getString(2));
                   form3.setsPublicadoProfesor3(rs.getString(3));
                   form3.setsReferenciaProfesor3(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor4(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion4(rs.getString(2));
                   form3.setsPublicadoProfesor4(rs.getString(3));
                   form3.setsReferenciaProfesor4(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor5(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion5(rs.getString(2));
                   form3.setsPublicadoProfesor5(rs.getString(3));
                   form3.setsReferenciaProfesor5(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor6(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion6(rs.getString(2));
                   form3.setsPublicadoProfesor6(rs.getString(3));
                   form3.setsReferenciaProfesor6(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor7(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion7(rs.getString(2));
                   form3.setsPublicadoProfesor7(rs.getString(3));
                   form3.setsReferenciaProfesor7(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor8(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion8(rs.getString(2));
                   form3.setsPublicadoProfesor8(rs.getString(3));
                   form3.setsReferenciaProfesor8(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor9(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion9(rs.getString(2));
                   form3.setsPublicadoProfesor9(rs.getString(3));
                   form3.setsReferenciaProfesor9(rs.getString(4));
                }

                if(rs.next()){
                   form3.setsNombreProfesor0(rs.getString(1));
                   form3.setsNombreTrabajoInvestigacion0(rs.getString(2));
                   form3.setsPublicadoProfesor0(rs.getString(3));
                   form3.setsReferenciaProfesor0(rs.getString(4));
                }
                exito = true;
            }

            if( cs3.execute("SELECT * FROM sp_buscaDatosFormulario3aux6(" + form3.getnIdFormulario() + ")") ) {
                rs = cs3.getResultSet();
                if(rs.next()){
                    form3.setsNombreParticipacionProfesor1(rs.getString(1));
                    form3.setsEvento1(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor2(rs.getString(1));
                    form3.setsEvento2(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor3(rs.getString(1));
                    form3.setsEvento3(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor4(rs.getString(1));
                    form3.setsEvento4(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor5(rs.getString(1));
                    form3.setsEvento5(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor6(rs.getString(1));
                    form3.setsEvento6(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor7(rs.getString(1));
                    form3.setsEvento7(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor8(rs.getString(1));
                    form3.setsEvento8(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor9(rs.getString(1));
                    form3.setsEvento9(rs.getString(2));
                }

                 if(rs.next()){
                    form3.setsNombreParticipacionProfesor0(rs.getString(1));
                    form3.setsEvento0(rs.getString(2));
                }
                exito = true;
            }


        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;

    }

    public static boolean busquedaFormulario4(FormularioBean4 form4) {

        boolean exito = false;

        try {
            ResultSet rs;
            Statement cs4 = conn.createStatement();

            if( cs4.execute("SELECT nIdFormulario4 FROM Formulario4 WHERE nIdVisita = " + form4.getnIdVisita() ) ) {
                rs = cs4.getResultSet();

                if( rs.next() ) {
                    form4.setnIdFormulario( rs.getInt(1) );
                }
                else {
                    return false;
                }
            }

            if( cs4.execute("SELECT * FROM sp_buscadatosformulario4(" + form4.getnIdFormulario() + ")") ) {
                rs = cs4.getResultSet();

                if( rs.next() ) {
                    form4.setnAsistenciaConferencias( rs.getInt(1) );
                    form4.setnAsistenciaSesionesClinicas( rs.getInt(2) );
                    form4.setnAsistenciaSeminarios( rs.getInt(3) );
                    form4.setnMesasRedondas( rs.getInt(4) );
                    form4.setnSesionesBiograficas( rs.getInt(5) );
                    form4.setnTalleres( rs.getInt(6) );
                    form4.setnOtrasActividades( rs.getInt(7) );
                    
                    form4.setsAsignacionTutor( rs.getString(8) );
                    form4.setsAreasDescanso( rs.getString(9) );
                    form4.setsSanitariosPropios( rs.getString(10) );

                    form4.setsCondicionesAreas( rs.getString(11) );
                    form4.setsConocimientosPrevios( rs.getString(12) );
                    form4.setsPercepcionProcesoEnseApren( rs.getString(13) );

                    form4.setsComentPercepcionProcesoEnseApren( rs.getString(14) );
                    form4.setnIdVisita( rs.getInt(15) );
                }
            }

            if( cs4.execute("SELECT * FROM sp_buscadatosformulario4r(" + form4.getnIdFormulario() + ")") ) {
                rs = cs4.getResultSet();

                if( rs.next() ) {
                    form4.setnEnsenanzaTeorica1( rs.getInt(1) );
                    form4.setnPracticaClinicaSupervision1( rs.getInt(2) );
                    form4.setnPracticaClinicaSinSupervision1( rs.getInt(3) );
                    form4.setnGuardiasSupervision1( rs.getInt(4) );
                    form4.setnGuardiasSinSupervision1( rs.getInt(5) );
                }
                
                if( rs.next() ) {
                    form4.setnEnsenanzaTeorica2( rs.getInt(1) );
                    form4.setnPracticaClinicaSupervision2( rs.getInt(2) );
                    form4.setnPracticaClinicaSinSupervision2( rs.getInt(3) );
                    form4.setnGuardiasSupervision2( rs.getInt(4) );
                    form4.setnGuardiasSinSupervision2( rs.getInt(5) );
                }
                
                if( rs.next() ) {
                    form4.setnEnsenanzaTeorica3( rs.getInt(1) );
                    form4.setnPracticaClinicaSupervision3( rs.getInt(2) );
                    form4.setnPracticaClinicaSinSupervision3( rs.getInt(3) );
                    form4.setnGuardiasSupervision3( rs.getInt(4) );
                    form4.setnGuardiasSinSupervision3( rs.getInt(5) );
                }
                
                if( rs.next() ) {
                    form4.setnEnsenanzaTeorica4( rs.getInt(1) );
                    form4.setnPracticaClinicaSupervision4( rs.getInt(2) );
                    form4.setnPracticaClinicaSinSupervision4( rs.getInt(3) );
                    form4.setnGuardiasSupervision4( rs.getInt(4) );
                    form4.setnGuardiasSinSupervision4( rs.getInt(5) );
                }
                
                if( rs.next() ) {
                    form4.setnEnsenanzaTeorica5( rs.getInt(1) );
                    form4.setnPracticaClinicaSupervision5( rs.getInt(2) );
                    form4.setnPracticaClinicaSinSupervision5( rs.getInt(3) );
                    form4.setnGuardiasSupervision5( rs.getInt(4) );
                    form4.setnGuardiasSinSupervision5( rs.getInt(5) );
                }
                
                if( rs.next() ) {
                    form4.setnEnsenanzaTeorica6( rs.getInt(1) );
                    form4.setnPracticaClinicaSupervision6( rs.getInt(2) );
                    form4.setnPracticaClinicaSinSupervision6( rs.getInt(3) );
                    form4.setnGuardiasSupervision6( rs.getInt(4) );
                    form4.setnGuardiasSinSupervision6( rs.getInt(5) );
                }
                
                if( rs.next() ) {
                    form4.setnEnsenanzaTeoricaOtros( rs.getInt(1) );
                    form4.setnPracticaClinicaSupervisionOtros( rs.getInt(2) );
                    form4.setnPracticaClinicaSinSupervisionOtros( rs.getInt(3) );
                    form4.setnGuardiasSupervisionOtros( rs.getInt(4) );
                    form4.setnGuardiasSinSupervisionOtros( rs.getInt(5) );
                }

                exito = true;
            }

        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean busquedaFormulario5(FormularioBean5 form5) {

        boolean exito = false;

        try {
            ResultSet rs;
            Statement cs5 = conn.createStatement();

            if( cs5.execute("SELECT nIdFormulario5 FROM Formulario5 WHERE nIdVisita = " + form5.getnIdVisita() ) ) {
                rs = cs5.getResultSet();

                if( rs.next() ) {
                    form5.setnIdFormulario( rs.getInt(1) );
                }
                else {
                    return false;
                }
            }

            if( cs5.execute("SELECT * FROM sp_buscadatosformulario5(" + form5.getnIdFormulario() + ")") ) {
                rs = cs5.getResultSet();

                if( rs.next() ) {

                    form5.setsPeliculasVideocintas(rs.getString(1));
                    form5.setsGrabacionesAudio(rs.getString(2));
                    form5.setsModelosPiezasMuseo(rs.getString(3));
                    form5.setsProgramasComputarizados(rs.getString(4));
                    form5.setsOtroMaterialDidactico(rs.getString(5));
                    form5.setsEspecificacionMaterialDidactico(rs.getString(6));

                    form5.setsCanonesProyeccion(rs.getString(7));
                    form5.setsMonitoresTv(rs.getString(8));
                    form5.setsVideocasseteras(rs.getString(9));
                    form5.setsComputadoras(rs.getString(10));
                    form5.setsOtroAudiovisual(rs.getString(11));
                    form5.setsEspecificacionAudiovisual(rs.getString(12));

                    form5.setsAccesoComputo(rs.getString(13));
                    form5.setsExpedienteElectronico(rs.getString(14));

                    form5.setsSalaJuntas(rs.getString(15));
                    form5.setnNumeroSalas(rs.getInt(16));
                    form5.setnCapacidadSalas(rs.getInt(17));

                    form5.setsAulasCurso(rs.getString(18));
                    form5.setnNumeroAulasCurso(rs.getInt(19));
                    form5.setnCapacidadAulasCurso(rs.getInt(20));

                    form5.setsAuditorios(rs.getString(21));
                    form5.setnNumeroAuditorios(rs.getInt(22));
                    form5.setnCapacidadAuditorios(rs.getInt(23));

                    form5.setsBibliohemeroteca(rs.getString(24));
                    form5.setsAccesoBibliotecasDigitales(rs.getString(25));
                    form5.setsBibliotecaDigitalInstitucion(rs.getString(26));
                    form5.setsBibliotecaDigitalUNAM(rs.getString(27));
                    form5.setsBibliotecaDigitalOtras(rs.getString(28));

                    form5.setsFotocopiado(rs.getString(29));
                    form5.setsBusquedaInformacion(rs.getString(30));
                    form5.setsAccesoInternetNodos(rs.getString(31));

                    form5.setsAccesoInternetInalambrico(rs.getString(32));
                    form5.setsWifiSoloBiblioteca(rs.getString(33));
                    form5.setsWifiDiversosSitiosHospital(rs.getString(34));
                    form5.setsWifiTodoHospital(rs.getString(35));

                    form5.setsDiseminacionInformacion(rs.getString(36));
                    form5.setsPrestamosInterbibliotecarios(rs.getString(37));
                    form5.setsPrestamosDomicilio(rs.getString(38));
                    form5.setsOtrosServiciosBibliohemeroteca(rs.getString(39));
                    form5.setsEspecificacionServiciosBibliohemeroteca(rs.getString(40));

                    form5.setsSubsidioPersonal(rs.getString(41));
                    form5.setnIdVisita( rs.getInt(42) );
                }
            }

            Statement cs51 = conn.createStatement();

            if( cs51.execute("SELECT * FROM sp_buscadatosformulario5R1(" + form5.getnIdFormulario() + ")") ) {
                rs = cs51.getResultSet();

                if( rs.next() ) {

                    form5.setsNombreRevistaNac1(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac2(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac3(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac4(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac5(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac6(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac7(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac8(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac9(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaNac0(rs.getString(1));
                }
            }

            Statement cs52 = conn.createStatement();

            if( cs52.execute("SELECT * FROM sp_buscadatosformulario5R2(" + form5.getnIdFormulario() + ")") ) {
                rs = cs52.getResultSet();

                if( rs.next() ) {
                    form5.setsNombreRevistaEx1(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx2(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx3(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx4(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx5(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx6(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx7(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx8(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx9(rs.getString(1));
                    rs.next();
                    form5.setsNombreRevistaEx0(rs.getString(1));

                    exito = true;
                }
            }


        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean busquedaFormulario6(FormularioBean6 form6){
        boolean exito = false;

        try{
            ResultSet rs;
            Statement cs6 = conn.createStatement();
            Statement cs6R1 = conn.createStatement();
            Statement cs6R2 = conn.createStatement();

            if( cs6.execute("SELECT nIdFormulario6 FROM Formulario6 WHERE nIdVisita = " + form6.getnIdVisita() ) ) {
                rs = cs6.getResultSet();

                if( rs.next() ) {
                    form6.setnIdFormulario( rs.getInt(1) );
                }
                else {
                    return false;
                }
            }

            if(cs6.execute("SELECT * FROM sp_buscadatosformulario6(" + form6.getnIdFormulario() + ")")){
                rs = cs6.getResultSet();
                if(rs.next()){
                    form6.setsBecasInstitucionNacionales(rs.getString(1));
                    form6.setnNumeroBecasNacionales(rs.getInt(2));
                    form6.setsBecasInstitucionExtranjeros(rs.getString(3));
                    form6.setnNumeroBecasExtranjeros(rs.getInt(4));
                    form6.setnIdVisita( rs.getInt(5) );
                }
            }
            
            if(cs6R1.execute("SELECT * FROM sp_buscadatosformulario6R1(" + form6.getnIdFormulario() + ")")){
                    rs = cs6R1.getResultSet();
                    if(rs.next()){
                        form6.setnR1Nac(rs.getInt(1));
                        form6.setnR2Nac(rs.getInt(2));
                        form6.setnR3Nac(rs.getInt(3));
                        form6.setnR4Nac(rs.getInt(4));
                        form6.setnR5Nac(rs.getInt(5));
                        form6.setnR6Nac(rs.getInt(6));
                        form6.setnOtrosNac(rs.getInt(7));
                        form6.setnTotalNac(rs.getInt(8));
                }
            }

            if(cs6R2.execute("SELECT * FROM sp_buscadatosformulario6R2(" + form6.getnIdFormulario() + ")")){
                    rs = cs6R2.getResultSet();
                    if(rs.next()){
                        form6.setnR1Ex(rs.getInt(1));
                        form6.setnR2Ex(rs.getInt(2));
                        form6.setnR3Ex(rs.getInt(3));
                        form6.setnR4Ex(rs.getInt(4));
                        form6.setnR5Ex(rs.getInt(5));
                        form6.setnR6Ex(rs.getInt(6));
                        form6.setnOtrosEx(rs.getInt(7));
                        form6.setnTotalEx(rs.getInt(8));
                        exito = true;
                }
            }
        }
        catch(SQLException ex){
            System.err.println("SQL Exception: " + ex.getMessage());
            System.err.println("SQL State: " + ex.getSQLState());
            System.err.println("VendorError " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean busquedaFormulario7(FormularioBean7 form7){
        boolean exito = false;

        try{
            ResultSet rs;
            Statement cs17 = conn.createStatement();

            if( cs17.execute("SELECT nIdFormulario7 FROM Formulario7 WHERE nIdVisita = " + form7.getnIdVisita() ) ) {
                rs = cs17.getResultSet();

                if( rs.next() ) {
                    form7.setnIdFormulario( rs.getInt(1) );
                }
                else {
                    return false;
                }
            }

            if( cs17.execute("SELECT * FROM sp_buscaDatosFormulario7(" + form7.getnIdFormulario() + ")") ) {
                rs = cs17.getResultSet();

                if(rs.next()){
                    form7.setnIdVisita( rs.getInt(1) );
                }
            }

            if( cs17.execute("SELECT * FROM sp_buscadatosformulario7R1(" + form7.getnIdFormulario() + ")") ) {
                rs = cs17.getResultSet();

                if(rs.next()){
                    form7.setsProblemaDiagnostico1(rs.getString(1));
                    form7.setsManejoPacientes1(rs.getString(2));
                    form7.setsProcedimientosDiagnostico1(rs.getString(3));
                    form7.setsParticipacionIntervencion1(rs.getString(4));
                    form7.setsPacientesCargo1(rs.getString(5));
                    form7.setsActividadesServicio1(rs.getString(6));
                    form7.setsActividadesInvestigacion1(rs.getString(7));
                }
            }
            Statement cs27 = conn.createStatement();
            if( cs27.execute("SELECT * FROM sp_buscadatosformulario7R2(" + form7.getnIdFormulario() + ")") ) {
                rs = cs27.getResultSet();

                if(rs.next()){
                    form7.setsProblemaDiagnostico2(rs.getString(1));
                    form7.setsManejoPacientes2(rs.getString(2));
                    form7.setsProcedimientosDiagnostico2(rs.getString(3));
                    form7.setsParticipacionIntervencion2(rs.getString(4));
                    form7.setsPacientesCargo2(rs.getString(5));
                    form7.setsActividadesServicio2(rs.getString(6));
                    form7.setsActividadesInvestigacion2(rs.getString(7));
                }
            }

            Statement cs37 = conn.createStatement();
            if( cs37.execute("SELECT * FROM sp_buscadatosformulario7R3(" + form7.getnIdFormulario() + ")") ) {
                rs = cs37.getResultSet();

                if(rs.next()){
                    form7.setsProblemaDiagnostico3(rs.getString(1));
                    form7.setsManejoPacientes3(rs.getString(2));
                    form7.setsProcedimientosDiagnostico3(rs.getString(3));
                    form7.setsParticipacionIntervencion3(rs.getString(4));
                    form7.setsPacientesCargo3(rs.getString(5));
                    form7.setsActividadesServicio3(rs.getString(6));
                    form7.setsActividadesInvestigacion3(rs.getString(7));
                }
            }
            Statement cs47 = conn.createStatement();
            if( cs47.execute("SELECT * FROM sp_buscadatosformulario7R4(" + form7.getnIdFormulario() + ")") ) {
                rs = cs47.getResultSet();

                if(rs.next()){
                    form7.setsProblemaDiagnostico4(rs.getString(1));
                    form7.setsManejoPacientes4(rs.getString(2));
                    form7.setsProcedimientosDiagnostico4(rs.getString(3));
                    form7.setsParticipacionIntervencion4(rs.getString(4));
                    form7.setsPacientesCargo4(rs.getString(5));
                    form7.setsActividadesServicio4(rs.getString(6));
                    form7.setsActividadesInvestigacion4(rs.getString(7));
                }
            }

            Statement cs57 = conn.createStatement();
            if( cs57.execute("SELECT * FROM sp_buscadatosformulario7R5(" + form7.getnIdFormulario() + ")") ) {
                rs = cs57.getResultSet();
                if(rs.next()){
                    form7.setsProblemaDiagnostico5(rs.getString(1));
                    form7.setsManejoPacientes5(rs.getString(2));
                    form7.setsProcedimientosDiagnostico5(rs.getString(3));
                    form7.setsParticipacionIntervencion5(rs.getString(4));
                    form7.setsPacientesCargo5(rs.getString(5));
                    form7.setsActividadesServicio5(rs.getString(6));
                    form7.setsActividadesInvestigacion5(rs.getString(7));
                }
            }

            Statement cs67 = conn.createStatement();
            if( cs67.execute("SELECT * FROM sp_buscadatosformulario7R6(" + form7.getnIdFormulario() + ")") ) {
                rs = cs67.getResultSet();

                if(rs.next()){
                    form7.setsProblemaDiagnostico6(rs.getString(1));
                    form7.setsManejoPacientes6(rs.getString(2));
                    form7.setsProcedimientosDiagnostico6(rs.getString(3));
                    form7.setsParticipacionIntervencion6(rs.getString(4));
                    form7.setsPacientesCargo6(rs.getString(5));
                    form7.setsActividadesServicio6(rs.getString(6));
                    form7.setsActividadesInvestigacion6(rs.getString(7));
                }
            }
            Statement cso7 = conn.createStatement();
            if( cso7.execute("SELECT * FROM sp_buscadatosformulario7ro(" + form7.getnIdFormulario() + ")") ) {
                rs = cso7.getResultSet();

                if(rs.next()){
                    form7.setsProblemaDiagnosticoOtros(rs.getString(1));
                    form7.setsManejoPacientesOtros(rs.getString(2));
                    form7.setsProcedimientosDiagnosticoOtros(rs.getString(3));
                    form7.setsParticipacionIntervencionOtros(rs.getString(4));
                    form7.setsPacientesCargoOtros(rs.getString(5));
                    form7.setsActividadesServicioOtros(rs.getString(6));
                    form7.setsActividadesInvestigacionOtros(rs.getString(7));
                    exito = true;
                }
            }
        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }
    
    public static boolean busquedaFormulario8(FormularioBean8 form8) {

        boolean exito = false;

        try {
            ResultSet rs;
            Statement cs8 = conn.createStatement();

            if( cs8.execute("SELECT nIdFormulario8 FROM Formulario8 WHERE nIdVisita = " + form8.getnIdVisita() ) ) {
                rs = cs8.getResultSet();

                if( rs.next() ) {
                    form8.setnIdFormulario( rs.getInt(1) );
                }
                else {
                    return false;
                }
            }

            if( cs8.execute("SELECT * FROM sp_buscadatosformulario8(" + form8.getnIdFormulario() + ")") ) {
                rs = cs8.getResultSet();

                if( rs.next()) {
                    form8.setsConocimientosMedicos( rs.getString(1) );
                    form8.setsDestrezas( rs.getString(2) );
                    form8.setnIdVisita( rs.getInt(3) );
                }
                exito = true;
            }
        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean actualizaFormulario1(FormularioBean1 form1) {

        boolean exito = false;

        try {
            CallableStatement
            cs1 = conn.prepareCall("{call sp_ActualizaFormulario1(?, ?, ?, ?, ?, ?,"
                       + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                       + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, "
                       + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");

            cs1.setInt(1 , form1.getnIdHospital());
            cs1.setInt(2 , form1.getnIdCurso());
            cs1.setInt(3 , form1.getnEspecialistasMatutino());
            cs1.setInt(4 , form1.getnEspecialistasVespertino());
            cs1.setInt(5 , form1.getnEspecialistasNocturno());
            cs1.setInt(6 , form1.getnEspecialistasFinesSemana());
            cs1.setInt(7 , form1.getnCamasAdultos());
            cs1.setInt(8 , form1.getnCamasNinos());
            cs1.setInt(9 , form1.getnCunas());
            cs1.setInt(10, form1.getnIncubadoras());
            cs1.setString(11, form1.getsOtrasCensables());
            cs1.setInt(12, form1.getnOtrasCensables());
            cs1.setString(13, form1.getsEspecificacionCensables());
            cs1.setInt(14, form1.getnUrgencias());
            cs1.setInt(15, form1.getnTerapiaIntensiva());
            cs1.setInt(16, form1.getnTerapiaIntermedia());
            cs1.setInt(17, form1.getnCirugiaAmbulatoria());
            cs1.setInt(18, form1.getnLaboratorioGabinete());
            cs1.setInt(19, form1.getnCunasNeonatosSanos());
            cs1.setInt(20, form1.getnCamasRecuperacionQuirofano());
            cs1.setInt(21, form1.getnTrabajoParto());
            cs1.setString(22, form1.getsOtrasNoCensables());
            cs1.setInt(23, form1.getnOtrasNoCensables());
            cs1.setString(24, form1.getsEspecificacionNoCensables());
            cs1.setString(25, form1.getsQuirofanos());
            cs1.setInt(26, form1.getnQuirofanos());
            cs1.setString(27, form1.getsSalasExpulsion());
            cs1.setInt(28, form1.getnSalasExpulsion());
            cs1.setString(29, form1.getsConsultaExterna());
            cs1.setInt(30, form1.getnConsultaExterna());
            cs1.setString(31, form1.getsSistemaRegistroCodificacion());
            cs1.setInt(32, form1.getnSistemaRegistroCodificacion());
            cs1.setString(33, form1.getsManualNormasProcedimientos());
            cs1.setInt(34, form1.getnManualNormasProcedimientos());
            cs1.setString(35, form1.getsArchivoMaterialDidactico());
            cs1.setInt(36, form1.getnArchivoMaterialDidactico());
            cs1.setString(37, form1.getsLaboratorioRutina());
            cs1.setString(38, form1.getsCondicionesLaboratorioRutina());
            cs1.setString(39, form1.getsComentariosLaboratorioRutina());
            cs1.setString(40, form1.getsLaboratoriosEspeciales());
            cs1.setString(41, form1.getsEspecificacionLaboratoriosEspeciales());
            cs1.setString(42, form1.getsCondicionesLaboratoriosEspeciales());
            cs1.setString(43, form1.getsComentarioLaboratoriosEspeciales());
            cs1.setString(44, form1.getsGabinetes());
            cs1.setString(45, form1.getsEspecificacionGabinetes());
            cs1.setString(46, form1.getsCondicionGabinetes());
            cs1.setString(47, form1.getsComentariosGabinetes());
            cs1.setString(48, form1.getsOtrosDiagnosticoTratamiento());
            cs1.setString(49, form1.getsEspecificacionOtrosDiagnosticoTratamiento());
            cs1.setString(50, form1.getsCondicionesOtrosDiagnosticoTratamiento());
            cs1.setString(51, form1.getsComentarioOtrosDiagnosticoTratamiento());
            cs1.setString(52, form1.getsComiteMorbilidad());
            cs1.setString(53, form1.getsComiteMortalidad());
            cs1.setString(54, form1.getsComiteInfecciones());
            cs1.setString(55, form1.getsComiteExpedienteClinico());
            cs1.setString(56, form1.getsComiteBioeticaEtica());
            cs1.setString(57, form1.getsComiteAuditoriaMedica());
            cs1.setString(58, form1.getsComiteEnsenanza());
            cs1.setString(59, form1.getsComiteBioseguridad());
            cs1.setString(60, form1.getsComiteCientifico());
            cs1.setString(61, form1.getsOtrosComites());
            cs1.setString(62, form1.getsEspecificacionOtrosComites());
            cs1.setInt(63 , form1.getnIdFormulario());

            cs1.execute();

            CallableStatement
            cs1aux = conn.prepareCall("{call sp_ActualizaAuxiliarFormulario1(?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");

            cs1aux.setString(1 , form1.getsProfesor1());
            cs1aux.setString(2 , form1.getsNombramiento1());
            cs1aux.setString(3 , form1.getsGrado1());
            cs1aux.setInt(4 , form1.getnAntiguedad1());
            cs1aux.setString(5, form1.getsCursos1());
            cs1aux.setString(6, form1.getsCertificado1());
            cs1aux.setString(7 , form1.getsProfesor2());
            cs1aux.setString(8 , form1.getsNombramiento2());
            cs1aux.setString(9 , form1.getsGrado2());
            cs1aux.setInt(10 , form1.getnAntiguedad2());
            cs1aux.setString(11, form1.getsCursos2());
            cs1aux.setString(12, form1.getsCertificado2());
            cs1aux.setString(13, form1.getsProfesor3());
            cs1aux.setString(14, form1.getsNombramiento3());
            cs1aux.setString(15, form1.getsGrado3());
            cs1aux.setInt(16, form1.getnAntiguedad3());
            cs1aux.setString(17, form1.getsCursos3());
            cs1aux.setString(18, form1.getsCertificado3());
            cs1aux.setString(19, form1.getsProfesor4());
            cs1aux.setString(20, form1.getsNombramiento4());
            cs1aux.setString(21, form1.getsGrado4());
            cs1aux.setInt(22, form1.getnAntiguedad4());
            cs1aux.setString(23, form1.getsCursos4());
            cs1aux.setString(24, form1.getsCertificado4());
            cs1aux.setString(25, form1.getsProfesor5());
            cs1aux.setString(26, form1.getsNombramiento5());
            cs1aux.setString(27, form1.getsGrado5());
            cs1aux.setInt(28, form1.getnAntiguedad5());
            cs1aux.setString(29, form1.getsCursos5());
            cs1aux.setString(30, form1.getsCertificado5());
            cs1aux.setString(31, form1.getsProfesor6());
            cs1aux.setString(32, form1.getsNombramiento6());
            cs1aux.setString(33, form1.getsGrado6());
            cs1aux.setInt(34, form1.getnAntiguedad6());
            cs1aux.setString(35, form1.getsCursos6());
            cs1aux.setString(36, form1.getsCertificado6());
            cs1aux.setString(37, form1.getsProfesor7());
            cs1aux.setString(38, form1.getsNombramiento7());
            cs1aux.setString(39, form1.getsGrado7());
            cs1aux.setInt(40, form1.getnAntiguedad7());
            cs1aux.setString(41, form1.getsCursos7());
            cs1aux.setString(42, form1.getsCertificado7());
            cs1aux.setString(43, form1.getsProfesor8());
            cs1aux.setString(44, form1.getsNombramiento8());
            cs1aux.setString(45, form1.getsGrado8());
            cs1aux.setInt(46, form1.getnAntiguedad8());
            cs1aux.setString(47, form1.getsCursos8());
            cs1aux.setString(48, form1.getsCertificado8());
            cs1aux.setString(49, form1.getsProfesor9());
            cs1aux.setString(50, form1.getsNombramiento9());
            cs1aux.setString(51, form1.getsGrado9());
            cs1aux.setInt(52, form1.getnAntiguedad9());
            cs1aux.setString(53, form1.getsCursos9());
            cs1aux.setString(54, form1.getsCertificado9());
            cs1aux.setString(55, form1.getsProfesor0());
            cs1aux.setString(56, form1.getsNombramiento0());
            cs1aux.setString(57, form1.getsGrado0());
            cs1aux.setInt(58, form1.getnAntiguedad0());
            cs1aux.setString(59, form1.getsCursos0());
            cs1aux.setString(60, form1.getsCertificado0());
            cs1aux.setInt(61 , form1.getnIdFormulario());

            cs1aux.execute();
            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean actualizaFormulario2(FormularioBean2 form2) {

        boolean exito = false;

        try {
            CallableStatement
            cs2 = conn.prepareCall("{call sp_actualizaformulario2(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");

            cs2.setString(1 , form2.getsNombreCo1());
            cs2.setString(2 , form2.getsNombreCo2());
            cs2.setString(3 , form2.getsNombreCo3());
            cs2.setString(4 , form2.getsNombreCo4());
            cs2.setString(5 , form2.getsNombreCo5());
            cs2.setString(6 , form2.getsNombreCo6());
            cs2.setString(7 , form2.getsNombreCo7());
            cs2.setString(8 , form2.getsNombreCo8());
            cs2.setString(9 , form2.getsNombreCo9());
            cs2.setString(10 , form2.getsNombreCo0());
            cs2.setString(11, form2.getsNombreCh1());
            cs2.setString(12, form2.getsNombreCh2());
            cs2.setString(13, form2.getsNombreCh3());
            cs2.setString(14, form2.getsNombreCh4());
            cs2.setString(15, form2.getsNombreCh5());
            cs2.setString(16, form2.getsNombreCh6());
            cs2.setString(17, form2.getsNombreCh7());
            cs2.setString(18, form2.getsNombreCh8());
            cs2.setString(19, form2.getsNombreCh9());
            cs2.setString(20, form2.getsNombreCh0());
            cs2.setString(21, form2.getsNombreP1());
            cs2.setString(22, form2.getsNombreP2());
            cs2.setString(23, form2.getsNombreP3());
            cs2.setString(24, form2.getsNombreP4());
            cs2.setString(25, form2.getsNombreP5());
            cs2.setString(26, form2.getsNombreP6());
            cs2.setString(27, form2.getsNombreP7());
            cs2.setString(28, form2.getsNombreP8());
            cs2.setString(29, form2.getsNombreP9());
            cs2.setString(30, form2.getsNombreP0());
            cs2.setString(31, form2.getsNombreCom1());
            cs2.setString(32, form2.getsNombreCom2());
            cs2.setString(33, form2.getsNombreCom3());
            cs2.setString(34, form2.getsNombreCom4());
            cs2.setString(35, form2.getsNombreCom5());
            cs2.setString(36, form2.getsNombreCom6());
            cs2.setString(37, form2.getsNombreCom7());
            cs2.setString(38, form2.getsNombreCom8());
            cs2.setString(39, form2.getsNombreCom9());
            cs2.setString(40, form2.getsNombreCom0());
            cs2.setString(41, form2.getsNombreElab1());
            cs2.setString(42, form2.getsNombreElab2());
            cs2.setString(43, form2.getsNombreElab3());
            cs2.setString(44, form2.getsNombreElab4());
            cs2.setString(45, form2.getsNombreElab5());
            cs2.setString(46, form2.getsNombreElab6());
            cs2.setString(47, form2.getsNombreElab7());
            cs2.setString(48, form2.getsNombreElab8());
            cs2.setString(49, form2.getsNombreElab9());
            cs2.setString(50, form2.getsNombreElab0());
            cs2.setString(51, form2.getsNombreEg1());
            cs2.setString(52, form2.getsNombreEg2());
            cs2.setString(53, form2.getsNombreEg3());
            cs2.setString(54, form2.getsNombreEg4());
            cs2.setString(55, form2.getsNombreEg5());
            cs2.setString(56, form2.getsNombreEg6());
            cs2.setString(57, form2.getsNombreEg7());
            cs2.setString(58, form2.getsNombreEg8());
            cs2.setString(59, form2.getsNombreEg9());
            cs2.setString(60, form2.getsNombreEg0());
            cs2.setString(61, form2.getsNombrePi1());
            cs2.setString(62, form2.getsNombrePi2());
            cs2.setString(63, form2.getsNombrePi3());
            cs2.setString(64, form2.getsNombrePi4());
            cs2.setString(65, form2.getsNombrePi5());
            cs2.setString(66, form2.getsNombrePi6());
            cs2.setString(67, form2.getsNombrePi7());
            cs2.setString(68, form2.getsNombrePi8());
            cs2.setString(69, form2.getsNombrePi9());
            cs2.setString(70, form2.getsNombrePi0());
            cs2.setInt(71, form2.getnPromedioMensualConsultasExternas());
            cs2.setInt(72, form2.getnAltasMejoriaCuracion());
            cs2.setInt(73, form2.getnAltaDefuncion());
            cs2.setInt(74, form2.getnPromedioMensualIntervenciones());
            cs2.setInt(75, form2.getnPromedioMensualPartosAtendidos());
            cs2.setInt(76, form2.getnAutopsias());
            cs2.setInt(77, form2.getnBiopsias());
            cs2.setInt(78, form2.getnCitologias());
            cs2.setInt(79, form2.getnIdFormulario());

            cs2.execute();

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean actualizaFormulario3(FormularioBean3 form3) {

        boolean exito = false;

        try {
            CallableStatement
            cs3 = conn.prepareCall("{call sp_actualizaformulario3(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");

            cs3.setString(1 , form3.getsPromedioMinimo());
            cs3.setInt(2 , form3.getnEspecificarPromedioMinimo());
            cs3.setString(3 , form3.getsExamenNacionalResidencias());
            cs3.setString(4 , form3.getsExamenCompetenciaAcademicaUNAM());
            cs3.setString(5 , form3.getsExamenTeoricoConocimientos());
            cs3.setString(6 , form3.getsResidenciaRotatoria());
            cs3.setString(7 , form3.getsExamenPsicometrico());
            cs3.setString(8 , form3.getsExamenIngles());
            cs3.setString(9 , form3.getsExamenPracticoDestrezas());
            cs3.setString(10 , form3.getsExamenSaludFisica());
            cs3.setString(11 , form3.getsEntrevistaPersonal());
            cs3.setString(12 , form3.getsAntecedentesInstitucionSalud());
            cs3.setString(13 , form3.getsEdadMaxima());
            cs3.setInt(14 , form3.getnEspecificacionEdadMaxima());
            cs3.setString(15 , form3.getsEstudiosPreviosOtraEspecialidad());
            cs3.setString(16 , form3.getsOtroCriterioAdmision());
            cs3.setString(17 , form3.getsEspecificarCriterioAdmision());
            cs3.setInt(18, form3.getnDuracionCurso());
            cs3.setString(19 , form3.getsEstudiosPreviosOtraEspecialidadMedica());
            cs3.setInt(20, form3.getnDuracionOtraEspecialidad());
            cs3.setString(21, form3.getsEspecificacionOtraEspecialidad());
            cs3.setString(22 , form3.getsResidenciaSoloUnidad());
            cs3.setString(23 , form3.getsUnidadesComplementarias());
            cs3.setString(24 , form3.getsPorObjetivos());
            cs3.setString(25 , form3.getsProgramaOperativo());
            cs3.setString(26 , form3.getsListadoTemas());
            cs3.setString(27 , form3.getsCartaDescriptiva());
            cs3.setString(28 , form3.getsProgramaRotacion());
            cs3.setString(29 , form3.getsModular());
            cs3.setString(30 , form3.getsAsignatura());
            cs3.setString(31 , form3.getsPorAnos());
            cs3.setString(32 , form3.getsPorSemestres());
            cs3.setString(33 , form3.getsOtraCaracteristica());
            cs3.setString(34 , form3.getsEspecificacionOtras());
            cs3.setString(35 , form3.getsAlumnosResidenciasFormales());
            cs3.setInt(36, form3.getnActividadesTeoricasGrupo());
            cs3.setInt(37, form3.getnActividadesTeoricasIndependientes());
            cs3.setInt(38, form3.getnPracticaClinicaIndependiente());
            cs3.setInt(39, form3.getnPracticaClinicaTutoria());
            cs3.setInt(40, form3.getnActivadadesInvestigacion());
            cs3.setInt(41, form3.getnActualizacion());
            cs3.setInt(42, form3.getnAplicacion());
            cs3.setInt(43, form3.getnGeneracion());
            cs3.setInt(44, form3.getnDesarrolloAutonomia());
            cs3.setInt(45, form3.getnDesarrolloCapacidades());
            cs3.setString(46, form3.getsSituacionesDesarrolloDestrezas());
            cs3.setString(47, form3.getsSituacionesGraduacionDestrezas());
            cs3.setString(48, form3.getsEnsenanzaDestrezasResidentes());
            cs3.setString(49, form3.getsEnsenanzaDestrezasProfesores());
            cs3.setString(50, form3.getsSupervisionDominio());
            cs3.setString(51, form3.getsProgramanActividades());
            cs3.setString(52, form3.getsExamenTeoricoOral());
            cs3.setString(53, form3.getsPeriodicidadExamenTeoricoOral());
            cs3.setString(54, form3.getsExamenTeoricoEscrito());
            cs3.setString(55, form3.getsPeriodicidadExamenTeoricoEscrito());
            cs3.setString(56, form3.getsExamenPractico());
            cs3.setString(57, form3.getsPeriodicidadExamenPractico());
            cs3.setString(58, form3.getsListasCotejo());
            cs3.setString(59, form3.getsObservacionLibre());
            cs3.setString(60, form3.getsGuiaObservacion());
            cs3.setString(61, form3.getsEscalasEvaluativas());
            cs3.setString(62, form3.getsOtroProcedimiento());
            cs3.setString(63, form3.getsEspecificarOtroProcedimiento());
            cs3.setString(64, form3.getsRetroalimentacion());
            cs3.setString(65, form3.getsPeriodicidadProgramaOperativo());
            cs3.setString(66, form3.getsAlumnosEnDepartamentales());
            cs3.setInt(67, form3.getnPorcentajeDepartamental());
            cs3.setInt(68, form3.getnSeminarioAtencionMedica());
            cs3.setInt(69, form3.getnTrabajoAtencionMedica());
            cs3.setInt(70, form3.getnSeminarioInvestigacion());
            cs3.setInt(71, form3.getnSeminarioEducacion());
            cs3.setString(72, form3.getsDificultades());
            cs3.setString(73, form3.getsEspecificacionDificultades());
            cs3.setString(74, form3.getsPercepcionEstres());
            cs3.setString(75, form3.getsComentariosPercepcionesEstres());
            cs3.setInt(76, form3.getnIdFormulario());

            cs3.execute();

            CallableStatement
            cs3aux1 = conn.prepareCall("{call sp_actualizaauxiliar1formulario3(?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?)}");

            cs3aux1.setString(1, form3.getsAreaRotacionPropia1());
            cs3aux1.setInt(2, form3.getnTiempoAreaRotacionPropia1());
            cs3aux1.setString(3, form3.getsAreaRotacionPropia2());
            cs3aux1.setInt(4, form3.getnTiempoAreaRotacionPropia2());
            cs3aux1.setString(5, form3.getsAreaRotacionPropia3());
            cs3aux1.setInt(6, form3.getnTiempoAreaRotacionPropia3());
            cs3aux1.setString(7, form3.getsAreaRotacionPropia4());
            cs3aux1.setInt(8, form3.getnTiempoAreaRotacionPropia4());
            cs3aux1.setString(9, form3.getsAreaRotacionPropia5());
            cs3aux1.setInt(10, form3.getnTiempoAreaRotacionPropia5());
            cs3aux1.setString(11, form3.getsAreaRotacionPropia6());
            cs3aux1.setInt(12, form3.getnTiempoAreaRotacionPropia6());
            cs3aux1.setString(13, form3.getsAreaRotacionPropia7());
            cs3aux1.setInt(14, form3.getnTiempoAreaRotacionPropia7());
            cs3aux1.setString(15, form3.getsAreaRotacionPropia8());
            cs3aux1.setInt(16, form3.getnTiempoAreaRotacionPropia8());
            cs3aux1.setString(17, form3.getsAreaRotacionPropia9());
            cs3aux1.setInt(18, form3.getnTiempoAreaRotacionPropia9());
            cs3aux1.setString(19, form3.getsAreaRotacionPropia0());
            cs3aux1.setInt(20, form3.getnTiempoAreaRotacionPropia0());
            cs3aux1.setString(21, form3.getsAreaRotacionComplementaria1());
            cs3aux1.setInt(22, form3.getnTiempoAreaRotacionComplementaria1());
            cs3aux1.setString(23, form3.getsAreaRotacionComplementaria2());
            cs3aux1.setInt(24, form3.getnTiempoAreaRotacionComplementaria2());
            cs3aux1.setString(25, form3.getsAreaRotacionComplementaria3());
            cs3aux1.setInt(26, form3.getnTiempoAreaRotacionComplementaria3());
            cs3aux1.setString(27, form3.getsAreaRotacionComplementaria4());
            cs3aux1.setInt(28, form3.getnTiempoAreaRotacionComplementaria4());
            cs3aux1.setString(29, form3.getsAreaRotacionComplementaria5());
            cs3aux1.setInt(30, form3.getnTiempoAreaRotacionComplementaria5());
            cs3aux1.setString(31, form3.getsAreaRotacionComplementaria6());
            cs3aux1.setInt(32, form3.getnTiempoAreaRotacionComplementaria6());
            cs3aux1.setString(33, form3.getsAreaRotacionComplementaria7());
            cs3aux1.setInt(34, form3.getnTiempoAreaRotacionComplementaria7());
            cs3aux1.setString(35, form3.getsAreaRotacionComplementaria8());
            cs3aux1.setInt(36, form3.getnTiempoAreaRotacionComplementaria8());
            cs3aux1.setString(37, form3.getsAreaRotacionComplementaria9());
            cs3aux1.setInt(38, form3.getnTiempoAreaRotacionComplementaria9());
            cs3aux1.setString(39, form3.getsAreaRotacionComplementaria0());
            cs3aux1.setInt(40, form3.getnTiempoAreaRotacionComplementaria0());
            cs3aux1.setString(41, form3.getsAreaSubsede1());
            cs3aux1.setInt(42, form3.getnTiempoSubsede1());
            cs3aux1.setString(43, form3.getsAreaSubsede2());
            cs3aux1.setInt(44, form3.getnTiempoSubsede2());
            cs3aux1.setString(45, form3.getsAreaSubsede3());
            cs3aux1.setInt(46, form3.getnTiempoSubsede3());
            cs3aux1.setString(47, form3.getsAreaSubsede4());
            cs3aux1.setInt(48, form3.getnTiempoSubsede4());
            cs3aux1.setString(49, form3.getsAreaSubsede5());
            cs3aux1.setInt(50, form3.getnTiempoSubsede5());
            cs3aux1.setString(51, form3.getsAreaSubsede6());
            cs3aux1.setInt(52, form3.getnTiempoSubsede6());
            cs3aux1.setString(53, form3.getsAreaSubsede7());
            cs3aux1.setInt(54, form3.getnTiempoSubsede7());
            cs3aux1.setString(55, form3.getsAreaSubsede8());
            cs3aux1.setInt(56, form3.getnTiempoSubsede8());
            cs3aux1.setString(57, form3.getsAreaSubsede9());
            cs3aux1.setInt(58, form3.getnTiempoSubsede9());
            cs3aux1.setString(59, form3.getsAreaSubsede0());
            cs3aux1.setInt(60, form3.getnTiempoSubsede0());
            cs3aux1.setInt(61, form3.getnExternoR1());
            cs3aux1.setInt(62, form3.getnExternoR2());
            cs3aux1.setInt(63, form3.getnExternoR3());
            cs3aux1.setInt(64, form3.getnExternoR4());
            cs3aux1.setInt(65, form3.getnExternoR5());
            cs3aux1.setInt(66, form3.getnExternoR6());
            cs3aux1.setInt(67, form3.getnExternoOtros());
            cs3aux1.setInt(68, form3.getnIdFormulario());


            cs3aux1.execute();

            CallableStatement
            cs3aux2 = conn.prepareCall("{call sp_actualizaauxiliar2formulario3(?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?)}");

            cs3aux2.setString(1, form3.getsNombre1());
            cs3aux2.setString(2, form3.getsNombreTrabajoInvestigacionResidente1());
            cs3aux2.setString(3, form3.getsPublicado1());
            cs3aux2.setString(4, form3.getsReferencia1());
            cs3aux2.setString(5, form3.getsNombre2());
            cs3aux2.setString(6, form3.getsNombreTrabajoInvestigacionResidente2());
            cs3aux2.setString(7, form3.getsPublicado2());
            cs3aux2.setString(8, form3.getsReferencia2());
            cs3aux2.setString(9, form3.getsNombre3());
            cs3aux2.setString(10, form3.getsNombreTrabajoInvestigacionResidente3());
            cs3aux2.setString(11, form3.getsPublicado3());
            cs3aux2.setString(12, form3.getsReferencia3());
            cs3aux2.setString(13, form3.getsNombre4());
            cs3aux2.setString(14, form3.getsNombreTrabajoInvestigacionResidente4());
            cs3aux2.setString(15, form3.getsPublicado4());
            cs3aux2.setString(16, form3.getsReferencia4());
            cs3aux2.setString(17, form3.getsNombre5());
            cs3aux2.setString(18, form3.getsNombreTrabajoInvestigacionResidente5());
            cs3aux2.setString(19, form3.getsPublicado5());
            cs3aux2.setString(20, form3.getsReferencia5());
            cs3aux2.setString(21, form3.getsNombre6());
            cs3aux2.setString(22, form3.getsNombreTrabajoInvestigacionResidente6());
            cs3aux2.setString(23, form3.getsPublicado6());
            cs3aux2.setString(24, form3.getsReferencia6());
            cs3aux2.setString(25, form3.getsNombre7());
            cs3aux2.setString(26, form3.getsNombreTrabajoInvestigacionResidente7());
            cs3aux2.setString(27, form3.getsPublicado7());
            cs3aux2.setString(28, form3.getsReferencia7());
            cs3aux2.setString(29, form3.getsNombre8());
            cs3aux2.setString(30, form3.getsNombreTrabajoInvestigacionResidente8());
            cs3aux2.setString(31, form3.getsPublicado8());
            cs3aux2.setString(32, form3.getsReferencia8());
            cs3aux2.setString(33, form3.getsNombre9());
            cs3aux2.setString(34, form3.getsNombreTrabajoInvestigacionResidente9());
            cs3aux2.setString(35, form3.getsPublicado9());
            cs3aux2.setString(36, form3.getsReferencia9());
            cs3aux2.setString(37, form3.getsNombre0());
            cs3aux2.setString(38, form3.getsNombreTrabajoInvestigacionResidente0());
            cs3aux2.setString(39, form3.getsPublicado0());
            cs3aux2.setString(40, form3.getsReferencia0());
            cs3aux2.setString(41, form3.getsNombreProfesor1());
            cs3aux2.setString(42, form3.getsNombreTrabajoInvestigacion1());
            cs3aux2.setString(43, form3.getsPublicadoProfesor1());
            cs3aux2.setString(44, form3.getsReferenciaProfesor1());
            cs3aux2.setString(45, form3.getsNombreProfesor2());
            cs3aux2.setString(46, form3.getsNombreTrabajoInvestigacion2());
            cs3aux2.setString(47, form3.getsPublicadoProfesor2());
            cs3aux2.setString(48, form3.getsReferenciaProfesor2());
            cs3aux2.setString(49, form3.getsNombreProfesor3());
            cs3aux2.setString(50, form3.getsNombreTrabajoInvestigacion3());
            cs3aux2.setString(51, form3.getsPublicadoProfesor3());
            cs3aux2.setString(52, form3.getsReferenciaProfesor3());
            cs3aux2.setString(53, form3.getsNombreProfesor4());
            cs3aux2.setString(54, form3.getsNombreTrabajoInvestigacion4());
            cs3aux2.setString(55, form3.getsPublicadoProfesor4());
            cs3aux2.setString(56, form3.getsReferenciaProfesor4());
            cs3aux2.setString(57, form3.getsNombreProfesor5());
            cs3aux2.setString(58, form3.getsNombreTrabajoInvestigacion5());
            cs3aux2.setString(59, form3.getsPublicadoProfesor5());
            cs3aux2.setString(60, form3.getsReferenciaProfesor5());
            cs3aux2.setString(61, form3.getsNombreProfesor6());
            cs3aux2.setString(62, form3.getsNombreTrabajoInvestigacion6());
            cs3aux2.setString(63, form3.getsPublicadoProfesor6());
            cs3aux2.setString(64, form3.getsReferenciaProfesor6());
            cs3aux2.setString(65, form3.getsNombreProfesor7());
            cs3aux2.setString(66, form3.getsNombreTrabajoInvestigacion7());
            cs3aux2.setString(67, form3.getsPublicadoProfesor7());
            cs3aux2.setString(68, form3.getsReferenciaProfesor7());
            cs3aux2.setString(69, form3.getsNombreProfesor8());
            cs3aux2.setString(70, form3.getsNombreTrabajoInvestigacion8());
            cs3aux2.setString(71, form3.getsPublicadoProfesor8());
            cs3aux2.setString(72, form3.getsReferenciaProfesor8());
            cs3aux2.setString(73, form3.getsNombreProfesor9());
            cs3aux2.setString(74, form3.getsNombreTrabajoInvestigacion9());
            cs3aux2.setString(75, form3.getsPublicadoProfesor9());
            cs3aux2.setString(76, form3.getsReferenciaProfesor9());
            cs3aux2.setString(77, form3.getsNombreProfesor0());
            cs3aux2.setString(78, form3.getsNombreTrabajoInvestigacion0());
            cs3aux2.setString(79, form3.getsPublicadoProfesor0());
            cs3aux2.setString(80, form3.getsReferenciaProfesor0());
            cs3aux2.setInt(81, form3.getnIdFormulario());

            cs3aux2.execute();

            CallableStatement
            cs3aux3 = conn.prepareCall("{call sp_actualizaauxiliar3formulario3(?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?)}");

            cs3aux3.setString(1, form3.getsNombreParticipacionProfesor1());
            cs3aux3.setString(2, form3.getsEvento1());
            cs3aux3.setString(3, form3.getsNombreParticipacionProfesor2());
            cs3aux3.setString(4, form3.getsEvento2());
            cs3aux3.setString(5, form3.getsNombreParticipacionProfesor3());
            cs3aux3.setString(6, form3.getsEvento3());
            cs3aux3.setString(7, form3.getsNombreParticipacionProfesor4());
            cs3aux3.setString(8, form3.getsEvento4());
            cs3aux3.setString(9, form3.getsNombreParticipacionProfesor5());
            cs3aux3.setString(10, form3.getsEvento5());
            cs3aux3.setString(11, form3.getsNombreParticipacionProfesor6());
            cs3aux3.setString(12, form3.getsEvento6());
            cs3aux3.setString(13, form3.getsNombreParticipacionProfesor7());
            cs3aux3.setString(14, form3.getsEvento7());
            cs3aux3.setString(15, form3.getsNombreParticipacionProfesor8());
            cs3aux3.setString(16, form3.getsEvento8());
            cs3aux3.setString(17, form3.getsNombreParticipacionProfesor9());
            cs3aux3.setString(18, form3.getsEvento9());
            cs3aux3.setString(19, form3.getsNombreParticipacionProfesor0());
            cs3aux3.setString(20, form3.getsEvento0());
            cs3aux3.setInt(21, form3.getnIdFormulario());

            cs3aux3.execute();

            exito = true;
        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean actualizaFormulario4(FormularioBean4 form4) {

        boolean exito = false;

        try {
            CallableStatement
            cs4 = conn.prepareCall("{call sp_ActualizaFormulario4(?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, ?, ?, ?, ?, ?, "
                                                               + "?, ?, "
                                                               + "?, ?, ?, "
                                                               + "?, ?)}");
            cs4.setInt(1 , form4.getnEnsenanzaTeorica1() );
            cs4.setInt(2 , form4.getnEnsenanzaTeorica2() );
            cs4.setInt(3 , form4.getnEnsenanzaTeorica3() );
            cs4.setInt(4 , form4.getnEnsenanzaTeorica4() );
            cs4.setInt(5 , form4.getnEnsenanzaTeorica5() );
            cs4.setInt(6 , form4.getnEnsenanzaTeorica6() );
            cs4.setInt(7 , form4.getnEnsenanzaTeoricaOtros() );

            cs4.setInt(8 , form4.getnPracticaClinicaSupervision1() );
            cs4.setInt(9 , form4.getnPracticaClinicaSupervision2() );
            cs4.setInt(10, form4.getnPracticaClinicaSupervision3() );
            cs4.setInt(11, form4.getnPracticaClinicaSupervision4() );
            cs4.setInt(12, form4.getnPracticaClinicaSupervision5() );
            cs4.setInt(13, form4.getnPracticaClinicaSupervision6() );
            cs4.setInt(14, form4.getnPracticaClinicaSupervisionOtros() );

            cs4.setInt(15, form4.getnPracticaClinicaSinSupervision1() );
            cs4.setInt(16, form4.getnPracticaClinicaSinSupervision2() );
            cs4.setInt(17, form4.getnPracticaClinicaSinSupervision3() );
            cs4.setInt(18, form4.getnPracticaClinicaSinSupervision4() );
            cs4.setInt(19, form4.getnPracticaClinicaSinSupervision5() );
            cs4.setInt(20, form4.getnPracticaClinicaSinSupervision6() );
            cs4.setInt(21, form4.getnPracticaClinicaSinSupervisionOtros() );

            cs4.setString(22, form4.getsAsignacionTutor() );

            cs4.setInt(23, form4.getnAsistenciaConferencias() );
            cs4.setInt(24, form4.getnAsistenciaSesionesClinicas() );
            cs4.setInt(25, form4.getnAsistenciaSeminarios() );
            cs4.setInt(26, form4.getnMesasRedondas() );
            cs4.setInt(27, form4.getnSesionesBiograficas() );
            cs4.setInt(28, form4.getnTalleres() );
            cs4.setInt(29, form4.getnOtrasActividades() );

            cs4.setInt(30, form4.getnGuardiasSupervision1() );
            cs4.setInt(31, form4.getnGuardiasSupervision2() );
            cs4.setInt(32, form4.getnGuardiasSupervision3() );
            cs4.setInt(33, form4.getnGuardiasSupervision4() );
            cs4.setInt(34, form4.getnGuardiasSupervision5() );
            cs4.setInt(35, form4.getnGuardiasSupervision6() );
            cs4.setInt(36, form4.getnGuardiasSupervisionOtros() );

            cs4.setInt(37, form4.getnGuardiasSinSupervision1() );
            cs4.setInt(38, form4.getnGuardiasSinSupervision2() );
            cs4.setInt(39, form4.getnGuardiasSinSupervision3() );
            cs4.setInt(40, form4.getnGuardiasSinSupervision4() );
            cs4.setInt(41, form4.getnGuardiasSinSupervision5() );
            cs4.setInt(42, form4.getnGuardiasSinSupervision6() );
            cs4.setInt(43, form4.getnGuardiasSinSupervisionOtros() );

            cs4.setString(44, form4.getsAreasDescanso() );
            cs4.setString(45, form4.getsSanitariosPropios() );

            cs4.setString(46, form4.getsCondicionesAreas() );
            cs4.setString(47, form4.getsConocimientosPrevios() );
            cs4.setString(48, form4.getsPercepcionProcesoEnseApren() );

            cs4.setString(49, form4.getsComentPercepcionProcesoEnseApren() );
            cs4.setInt(50, form4.getnIdFormulario());

            cs4.execute();

            exito = true;

        } catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean actualizaFormulario5(FormularioBean5 form5) {

        boolean exito = false;

        try {
            CallableStatement
            cs5 = conn.prepareCall("{call sp_actualizaformulario5(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");
            cs5.setString(1 , form5.getsPeliculasVideocintas());
            cs5.setString(2 , form5.getsGrabacionesAudio());
            cs5.setString(3 , form5.getsModelosPiezasMuseo());
            cs5.setString(4 , form5.getsProgramasComputarizados());
            cs5.setString(5 , form5.getsOtroMaterialDidactico());
            cs5.setString(6 , form5.getsEspecificacionMaterialDidactico());
            cs5.setString(7 , form5.getsCanonesProyeccion());
            cs5.setString(8 , form5.getsMonitoresTv());
            cs5.setString(9 , form5.getsVideocasseteras());
            cs5.setString(10 , form5.getsComputadoras());
            cs5.setString(11, form5.getsOtroAudiovisual());
            cs5.setString(12, form5.getsEspecificacionAudiovisual());
            cs5.setString(13, form5.getsAccesoComputo());
            cs5.setString(14, form5.getsExpedienteElectronico());
            cs5.setString(15, form5.getsSalaJuntas());
            cs5.setInt(16, form5.getnNumeroSalas());
            cs5.setInt(17, form5.getnCapacidadSalas());
            cs5.setString(18, form5.getsAulasCurso());
            cs5.setInt(19, form5.getnNumeroAulasCurso());
            cs5.setInt(20, form5.getnCapacidadAulasCurso());
            cs5.setString(21,form5.getsAuditorios());
            cs5.setInt(22, form5.getnNumeroAuditorios());
            cs5.setInt(23, form5.getnCapacidadAuditorios());
            cs5.setString(24, form5.getsBibliohemeroteca());
            cs5.setString(25, form5.getsAccesoBibliotecasDigitales());
            cs5.setString(26, form5.getsBibliotecaDigitalInstitucion());
            cs5.setString(27, form5.getsBibliotecaDigitalUNAM());
            cs5.setString(28, form5.getsBibliotecaDigitalOtras());
            cs5.setString(29, form5.getsFotocopiado());
            cs5.setString(30, form5.getsBusquedaInformacion());
            cs5.setString(31, form5.getsAccesoInternetNodos());
            cs5.setString(32, form5.getsAccesoInternetInalambrico());
            cs5.setString(33, form5.getsWifiSoloBiblioteca());
            cs5.setString(34, form5.getsWifiDiversosSitiosHospital());
            cs5.setString(35, form5.getsWifiTodoHospital());
            cs5.setString(36, form5.getsDiseminacionInformacion());
            cs5.setString(37, form5.getsPrestamosInterbibliotecarios());
            cs5.setString(38, form5.getsPrestamosDomicilio());
            cs5.setString(39, form5.getsOtrosServiciosBibliohemeroteca());
            cs5.setString(40, form5.getsEspecificacionServiciosBibliohemeroteca());
            cs5.setString(41, form5.getsSubsidioPersonal());
            cs5.setInt(42, form5.getnIdFormulario());

            cs5.execute();

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }
    
    public static boolean actualizaFormulario6(FormularioBean6 form6) {

        boolean exito = false;

        try {
            CallableStatement
            cs6 = conn.prepareCall("{call sp_actualizaformulario6(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}");
            cs6.setString(1 , form6.getsBecasInstitucionNacionales());
            cs6.setInt(2, form6.getnNumeroBecasNacionales());
            cs6.setString(3 , form6.getsBecasInstitucionExtranjeros());
            cs6.setInt(4, form6.getnNumeroBecasExtranjeros());
            cs6.setInt(5, form6.getnR1Nac());
            cs6.setInt(6, form6.getnR2Nac());
            cs6.setInt(7, form6.getnR3Nac());
            cs6.setInt(8, form6.getnR4Nac());
            cs6.setInt(9, form6.getnR5Nac());
            cs6.setInt(10, form6.getnR6Nac());
            cs6.setInt(11, form6.getnOtrosNac());
            form6.setnTotalNac(0);
            cs6.setInt(12, form6.getnTotalNac());
            cs6.setInt(13, form6.getnR1Ex());
            cs6.setInt(14, form6.getnR2Ex());
            cs6.setInt(15, form6.getnR3Ex());
            cs6.setInt(16, form6.getnR4Ex());
            cs6.setInt(17, form6.getnR5Ex());
            cs6.setInt(18, form6.getnR6Ex());
            cs6.setInt(19, form6.getnOtrosEx());
            form6.setnTotalEx(0);
            cs6.setInt(20, form6.getnTotalEx());
            cs6.setInt(21, form6.getnIdFormulario());

            cs6.execute();

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean actualizaFormulario7(FormularioBean7 form7) {

        boolean exito = false;

        try {
            CallableStatement
            cs7 = conn.prepareCall("{call sp_actualizaformulario7(?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
                    + " ?, ?, ?, ?, ?, ?, ?)}");

            cs7.setString(1 , form7.getsProblemaDiagnostico1());
            cs7.setString(2 , form7.getsManejoPacientes1());
            cs7.setString(3 , form7.getsProcedimientosDiagnostico1());
            cs7.setString(4 , form7.getsParticipacionIntervencion1());
            cs7.setString(5 , form7.getsPacientesCargo1());
            cs7.setString(6 , form7.getsActividadesServicio1());
            cs7.setString(7 , form7.getsActividadesInvestigacion1());
            cs7.setString(8 , form7.getsProblemaDiagnostico2());
            cs7.setString(9 , form7.getsManejoPacientes2());
            cs7.setString(10, form7.getsProcedimientosDiagnostico2());
            cs7.setString(11, form7.getsParticipacionIntervencion2());
            cs7.setString(12, form7.getsPacientesCargo2());
            cs7.setString(13, form7.getsActividadesServicio2());
            cs7.setString(14, form7.getsActividadesInvestigacion2());
            cs7.setString(15 , form7.getsProblemaDiagnostico3());
            cs7.setString(16, form7.getsManejoPacientes3());
            cs7.setString(17, form7.getsProcedimientosDiagnostico3());
            cs7.setString(18, form7.getsParticipacionIntervencion3());
            cs7.setString(19, form7.getsPacientesCargo3());
            cs7.setString(20, form7.getsActividadesServicio3());
            cs7.setString(21, form7.getsActividadesInvestigacion3());
            cs7.setString(22, form7.getsProblemaDiagnostico4());
            cs7.setString(23, form7.getsManejoPacientes4());
            cs7.setString(24, form7.getsProcedimientosDiagnostico4());
            cs7.setString(25, form7.getsParticipacionIntervencion4());
            cs7.setString(26, form7.getsPacientesCargo4());
            cs7.setString(27, form7.getsActividadesServicio4());
            cs7.setString(28, form7.getsActividadesInvestigacion4());
            cs7.setString(29, form7.getsProblemaDiagnostico5());
            cs7.setString(30, form7.getsManejoPacientes5());
            cs7.setString(31, form7.getsProcedimientosDiagnostico5());
            cs7.setString(32, form7.getsParticipacionIntervencion5());
            cs7.setString(33, form7.getsPacientesCargo5());
            cs7.setString(34, form7.getsActividadesServicio5());
            cs7.setString(35, form7.getsActividadesInvestigacion5());
            cs7.setString(36, form7.getsProblemaDiagnostico6());
            cs7.setString(37, form7.getsManejoPacientes6());
            cs7.setString(38, form7.getsProcedimientosDiagnostico6());
            cs7.setString(39, form7.getsParticipacionIntervencion6());
            cs7.setString(40, form7.getsPacientesCargo6());
            cs7.setString(41, form7.getsActividadesServicio6());
            cs7.setString(42, form7.getsActividadesInvestigacion6());
            cs7.setString(43, form7.getsProblemaDiagnosticoOtros());
            cs7.setString(44, form7.getsManejoPacientesOtros());
            cs7.setString(45, form7.getsProcedimientosDiagnosticoOtros());
            cs7.setString(46, form7.getsParticipacionIntervencionOtros());
            cs7.setString(47, form7.getsPacientesCargoOtros());
            cs7.setString(48, form7.getsActividadesServicioOtros());
            cs7.setString(49, form7.getsActividadesInvestigacionOtros());
            cs7.setInt(50, form7.getnIdFormulario());

            cs7.execute();

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }

    public static boolean actualizaFormulario8(FormularioBean8 form8) {

        boolean exito = false;

        try {
            CallableStatement
            cs8 = conn.prepareCall("{call sp_ActualizaFormulario8(?, ?, ?)}");
            cs8.setString(1 , form8.getsConocimientosMedicos());
            cs8.setString(2 , form8.getsDestrezas() );
            cs8.setInt(3, form8.getnIdFormulario());

            cs8.execute();

            exito = true;

        }
        catch (SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
            System.err.println("SQLState: " + ex.getSQLState());
            System.err.println("VendorError: " + ex.getErrorCode());
        }
        return exito;
    }
}
